Icon
A Material Symbols Rounded UI icon, drawn as inline SVG and filled in currentColor, so it takes the ink of the part it sits in.
import { Icon } from '@fairgarden/design/foundations/icon'
Icons are per-icon SVG paths generated from @material-symbols/svg-400 to svg-700, so there is no icon font to load. Give an icon a label when it stands alone; beside a visible label or inside a named control, omit it and the icon is hidden from assistive technology.
Size tiers
Size tiers
Three tiers, never scaled in between: inline 16 px beside text, tag 20 px in tags and chips, block 36 px in feature blocks. Each tier draws the Material Symbols weight whose stroke matches its line weight, so an icon sits at the same weight as the rules and edges around it.
Weights
Rest and emphasis weights
The weight follows the tier. weight="emphasis" draws the next stroke weight at the same size, as the weight-change cue of a pressed or selected state; the glyph never grows.
| Tier | Size | Target stroke | Rest weight | Emphasis weight |
|---|---|---|---|---|
inline | 16 px | --border-size-1-25 | 600 (1.32 px) | 700 (1.57 px) |
tag | 20 px | --border-size-1-5 | 500 (1.42 px) | 700 (1.96 px) |
block | 36 px | --border-size-2 | 400 (2.25 px) | 600 (2.97 px) |
The weights were measured from the packages' stems, not guessed; iconTierWeights in @fairgarden/design/icons/paths holds them.
inline 16 px600700tag 20 px500700block 36 px400600Hover and press
Hover and press
An icon inside a control thickens on hover instead of changing color or size. Give the control the iconHost class and the icon weight="interactive": the icon swaps to its emphasis weight while the control is hovered or pressed, and keeps its rest weight while the control is disabled or busy. In a CSS module, compose the class instead:
.base {
composes: iconHost from '@fairgarden/design/foundations/icon/icon.module.css';
}The inventory
The inventory
The UI inventory, by Material Symbols name. Glyphs that point along the inline axis (arrow_forward, chevron_left, chevron_right) mirror in right-to-left layouts.
searcharrow_forwardarrow_upwardexpand_morecloseremoveaddcheckcirclechevron_rightchevron_leftmenumore_horizmore_vertplay_arrowpausedownloadzoom_inzoom_outrecenterhelpmailcontent_copylinkopen_in_newrestart_altdescriptionwidgetsdeployed_codeformat_h2format_h3
On grounds
On paper, forest and leaf
Icon has no primary or secondary props. Its color is its part's ink role, so it follows the ground and the page mode without a selector of its own.
API Reference
A Material Symbols Rounded UI icon, drawn as inline SVG in currentColor
(FILL 0) at its tier’s calibrated weight. The one FILL 1 instance,
circle, is a selection mark only and must always travel with a second
cue (a bar, a weight change, an edge change or a word): state is never
shown by fill alone [D166].
| Prop | Type | Description |
|---|---|---|
name | | The §6.10 inventory name (Material Symbols Rounded). |
label | | Accessible name. Omit it for an icon beside a visible label or inside a named control: the icon is then hidden from assistive technology. |
weight | |
|
icon
iconHost
The host class for weight="interactive" icons (§10.1 icon states). Add it
to the element whose hover or press swaps the icon to its emphasis weight
(a button, a cell, a link), or compose it in the host’s module:
composes: iconHost from '../icon/icon.module.css'. Kept out of the
client module, so a server component reads the class name itself.
type iconHost = stringIconName
type IconName =
| 'link'
| 'menu'
| 'search'
| 'circle'
| 'arrow_forward'
| 'arrow_upward'
| 'expand_more'
| 'close'
| 'remove'
| 'add'
| 'check'
| 'chevron_right'
| 'chevron_left'
| 'more_horiz'
| 'more_vert'
| 'play_arrow'
| 'pause'
| 'download'
| 'zoom_in'
| 'zoom_out'
| 'recenter'
| 'help'
| 'mail'
| 'content_copy'
| 'open_in_new'
| 'restart_alt'
| 'description'
| 'widgets'
| 'deployed_code'
| 'format_h2'
| 'format_h3'IconProps
Props for Icon: SVG props (without children, color, fill and size), the size tier, the name and the weight state.
type IconProps = Omit<React.SVGProps<SVGSVGElement>, 'children' | 'color' | 'fill' | 'size'> &
VariantProps<__type> & {
name:
| 'link'
| 'menu'
| 'search'
| 'circle'
| 'arrow_forward'
| 'arrow_upward'
| 'expand_more'
| 'close'
| 'remove'
| 'add'
| 'check'
| 'chevron_right'
| 'chevron_left'
| 'more_horiz'
| 'more_vert'
| 'play_arrow'
| 'pause'
| 'download'
| 'zoom_in'
| 'zoom_out'
| 'recenter'
| 'help'
| 'mail'
| 'content_copy'
| 'open_in_new'
| 'restart_alt'
| 'description'
| 'widgets'
| 'deployed_code'
| 'format_h2'
| 'format_h3';
label?: string;
weight?: IconWeightState;
}IconTier
type IconTier = 'inline' | 'tag' | 'block'IconWeightState
Which weight instance an icon draws (§10.1 icon states) [D166]:
rest: the tier’s calibrated weight;emphasis: the next stroke tier’s weight at the same size, pinned;interactive: rest, swapping to emphasis while aniconHostancestor is hovered or pressed.
type IconWeightState = 'rest' | 'emphasis' | 'interactive'Specification: DESIGN-SYSTEM.md §6.10 (icons) and §1.5.12 (sizing).