When to use
Section titled “When to use”Use Icon for small glyphs that support or replace text: button and field icons, status marks, menu items. All icons come from a single registry.
When not to use
Section titled “When not to use”- For decorative pictures or drawings: Icon draws only registry glyphs; use an image for illustrations and photos.
- For interaction: Icon is not clickable and takes no focus. To act on an icon, use IconButton.
- For a glyph that is not in the registry: An unknown name is a type error. Add the name to the registry first.
Anatomy
Section titled “Anatomy”xssmmdlgxlimport { Icon } from '@bigbang/ui';
export default function Sizes() { return ( <div className="flex items-end gap-lg"> {(['xs', 'sm', 'md', 'lg', 'xl'] as const).map((size) => ( <span key={size} className="flex flex-col items-center gap-xs"> <Icon name="star" size={size} /> <code className="type-body-sm text-fg-subtle">{size}</code> </span> ))} </div> );}- Glyph: The SVG that matches the registry name; stroke width 2,
focusable="false". - Box: A square from the
icon-size-*token;xs12 px up toxl32 px.
Behaviour
Section titled “Behaviour”- Icon is static: it does not change on hover, click or focus, and it is not in the tab order.
nameis a type error, not a runtime fallback: a name that is not in the registry does not compile.- The default
tone="current"takes the icon colour from the surrounding text; when the text colour changes, so does the icon. size="inherit"fits the icon to the box of the parent component (size-full). Button icon slots use it.arrow-left,arrow-right,chevron-left,chevron-right,external-linkandlog-outflip horizontally underdir="rtl".- Without
label, the icon carriesaria-hidden="true"; withlabel, it getsrole="img"andaria-label.
Guidelines
Section titled “Guidelines”Use the icon with text
Section titled “Use the icon with text”Icons alone can be unclear. With text, the icon is decoration; without text, give the icon a label.
Tone for meaning, meaning for tone
Section titled “Tone for meaning, meaning for tone”Use the danger, success, warning and info tones only for their meaning. For decoration, current or subtle is enough.
Do not name an icon inside a control
Section titled “Do not name an icon inside a control”An icon inside a Button stays decorative; the control carries the name. With a label on the icon, the name is announced twice.
Content
Section titled “Content”labelis one or two words and says what the icon means: “Warning”, “Information”.- Write the meaning of the icon, not its look (“red triangle”).
- Give
labelonly when the icon alone carries information; skip it when text next to it already says so.
| Turkish | English | Icon and tone |
|---|---|---|
| Uyarı | Warning | triangle-alert, warning |
| Bilgi | Information | info, info |
| Başarılı | Success | circle-check, success |
| Hata | Error | circle-x, danger |