Copyright © 2016 IBM
See a problem with the code? Need a new component? Have feedback? We'd love to hear it all! The success of the Bluemix Design System relies on great people like yourself. Fill out the form below to submit your issue to our GitHub repo.
A member of the Bluemix Design System's team will be in touch within 48 hours.
Your issue, , is now in the bluemix-components repo. Click the issue number to track the progress or make edits to your issue.
We will get back to you within 48 hours. Feel free to reach out to us on one of our slack channels if you have additional questions:
#bluemix-componentsEssentials
Version: 4.1.1
Note: copy.svg and copy--code.svg have been deprecated. Use copy--new.svg instead.
Iconography uses images and symbols to represent an object visually. They communicate a message and should be simple, distinct, and informative. Icons should be used sparingly throughout the product to provide clarity and reduce cognitive load on users.
You can find the source file for the icon library within the Design Kit.
Icons GitHub repo
Icon library
Service provider master icon list
IBM Design Language icon library
Icons come in 2 sizes: 24px
and 16px
.
While most icons occupy a square artboard, some icons may occupy a rectangular artboard where the width or height of the icons is either 24px
or 16px
.
In most cases, you can use icons at their original sizes.
NAME
DIMENSIONS
Standard (24)
24px x 24px
Glyph (16)
16px x 16px
All icons should be on a transparent background and centered within the artboard boundaries at one of the below standard dimensions.
When creating icons:
When using icons:
Interactive UI icons need to pass the same color contrast ratio as typography at a 4.5:1 ratio. UI icons are always a solid color. The color of the icon should depend on the importance of the icon's action.
If it is a primary action then the icon should be:
If the icon is a secondary or supplementary action, then the icon color should be:
Blue should always be used with an icon to show that it is interactive. For secondary UI icons, the hover state should be blue to help emphasize that it is interactive.
Exception: There is an exception to both the Blue and Neutral color rules. Certain icons, such as status or notification icons, can inherit their parent color. For example, a warning icon is yellow because warning notifications are yellow.
NORMAL
HOVER
DISABLED
PRIMARY (DARK)
Blue 30
Blue 20
@ 50% opacity
SECONDARY (DARK)
Navy-Gray-8
Blue 30
@ 50% opacity
PRIMARY (LIGHT)
Blue 51
Blue 40
@ 50% opacity
SECONDARY (LIGHT)
Navy-Gray-7
Blue 51
@ 50% opacity
Icons of the same size should have the same visual weight. One icon should not look heavier or lighter than another icon of the same size. Most UI Icons are drawn with a two pixel stroke.
Be mindful when resizing icons, make sure that the 2px stroke does not increase or decrease causing icons to look uneven. When scaling icons you should always start each icon at the same base size (preferably the default of 24px).
Glyphs or 16 pixel icons, should always be a filled icon. This adds visual weight to the icon, allowing it to maintain its proper emphasis and stay legible. Fine stroke weights can disappear or break at the glyph size.
When drawing or re-sizing icons make sure the vector always aligns to the base pixel grid. This ensures pixel clarity and crispness on all screen ratios. The x and y coordinates of icons should never contain decimals.
The following guidelines are for developers who are using bluemix-icons.
You can use sprite.svg or bluemix-icons.svg by serving it as a static asset (like an image file) and use it with the following HTML:
<!-- From static assets -->
<svg>
<use xlink:href="path/to/static-assets/img/sprite.svg#common--arrows"></use>
</svg>
Bluemix.Common provides an endpoint to access their currently installed version of bluemix-icons. Using the icons in your HTML will look like this.
<!-- From Bluemix.Common -->
<svg>
<use xlink:href="https://dev-console.stage1.ng.bluemix.net/api/v4/img/sprite.svg#common--arrows"></use>
</svg>
Important notes about Bluemix.Common:
Bluemix icons ships with two main SVG files that contain different sets of external SVG sprite files:
FILENAME
DESCRIPTION
SUPPORTED
API
bluemix-icons.svg
Contains current icons
3.x
and newer
/api/v5/files/bluemix-icons.svg
bluemix-icons.json
JSON file created from bluemix-icons.svg
3.x
and newer
sprite.svg
legacy SVG sprite
3.x
and older
/api/v4/files/sprite.svg
icons.json
legacy JSON file created from sprite.svg
3.x
and older
Note: The icons use original color by default, which should be black. Colors can be changed with CSS.
Some icons are colored while others are black by default. You can edit the fill to change this. See the temporary reference page for a guide with what xlink:href
to use.
To edit these icons in CSS, add your own class to the <svg>
. For example:
SCSS:
.icon--add {
fill: #cc6699;
}
HTML:
<svg class="icon--add">
<use xlink:href="path/to/sprite.svg#service--add-filled"></use>
</svg>
For screen reader accessibility, use <title>
element and aria-labelledby
attribute.
<svg class="icon--add" aria-labelledby="add">
<title id="add">Add a new service</title>
<use xlink:href="https://dev-console.stage1.ng.bluemix.net/api/v4/img/sprite.svg#common--add"></use>
</svg>
aria-labelledby
attribute will reference the id
attribute in the the <title>
element. Make sure that you do not duplicate this id
.<title>
element will be read by the screen reader to the user so it should describe it's purpose.If you would like to add an icon to our library, please submit a Pull Request in our GitHub Repo.
If you're not comfortable with making a Pull Request, please submit an issue in the repo with the icon attached.
svg/
folder.npm install
.npm run build
to rebuild the sprite.svg
.x
and y
coordinates or width and height fields.Shift + ⌘ + O
)#000000
and has no additional styling.#name--modifier
convention. (ex. copy.svg, copy--code.svg, add.svg, add--outline.svg).Example: This is what a Sketch artboard should look like before SVG export
#000000
and has no additional styling.SVG export options from Adobe Illustrator
These are contributing guidelines for adding UI icons.
Service icons: you can find all icons for internal services on the Master icon list on Release Blueprints.
Do not commit built files.
npm run build
Keep your branch up to date with master
branch.
npm install
to make use of dev environmentWhen submitting pull requests to bluemix-icons, simply add icons to svg folder directly.
Do not add new icons to svg subfolders, these are legacy icons that will be removed in 4.0.0
.
For example, icons in any subfolders, like taxonomy or common, are legacy icons.
All SVG icons are optimized through SVGO and other build steps to prepare icons for use via external SVG sprite files (sprite.svg and bluemix-icons.svg).
For example, here's how XML code for add--glyph.svg can look:
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path
d="(removed for brevity)"
id="Shape"
stroke="none"
fill="#000000"
fill-rule="evenodd"
></path>
</svg>
The XML code must have the following attributes:
width
and height
viewBox
fill-rule="evenodd"
It must not have the following nodes:
<g>
<style>
SVGO and other build steps will not optimize correctly when <g>
nodes are present.
Gulp is used for build tasks and are accessed via npm
scripts.
SVGO is used with various other gulp tasks to format external SVG sprite files. These should only be used when submitting pull requests that bump the repo to new versions.
See API reference here.