Skip to main content

Module icon

Module icon 

Source
Expand description

A glyph, drawn from the bundled catalog.

This is a display component: it reads a Glyph the caller chose and paints it. It installs no handlers and emits nothing. A glyph that can be clicked is IconButton, which already exists and is not reimplemented here.

Three things are deliberately not caller-supplied numbers:

  • Size comes from the token control scale, the same iconSize step Button already resolves, so a glyph beside a small button is the size a small button’s glyph is.
  • Colour comes from a semantic role, not an Hsla, so a glyph cannot name a colour the theme does not have.
  • Direction comes from the active LayoutDirection, and whether the glyph responds to it comes from the drawing via Glyph::mirrors_in_rtl.

§What assistive technology hears

Most glyphs in a real interface sit next to a label that already says what they mean, and announcing both says everything twice. So Icon::new is decorative: it publishes no semantic node at all, and a reader walks past it. A glyph that is the only carrier of its meaning has to be named, and Icon::named asks for both an Ident and the name, because a picture has no text to fall back on and there is no safe guess. The default is the quiet one, so forgetting to decide produces a silent icon rather than a wrong announcement.

Structs§

Icon
A glyph from the bundled catalog.

Enums§

IconTone
The semantic colour role a glyph paints in.

Functions§

flips
Whether glyph should be drawn flipped when the interface reads direction.
paint
One glyph, sized, coloured, and flipped or not.