Noora.Icon
(noora v0.82.3)
Copy Markdown
Icons in use across the Noora design system.
Usage
The module exposes all icons in two ways:
- As a function of the shape
<.{icon_name} /> - As an
iconcomponent that takes anameattribute.
<.mail />
<.icon name="mail" />Animated transitions
<.icon> can animate between two icons when the data-state of an ancestor
changes (e.g. a dropdown trigger opening). Pass active_name and a
transition strategy:
<.icon id="switcher" name="selector" active_name="selector_2" transition="morph"
watch="[data-part='trigger']" active_state="open" />Strategies:
"morph"— tween one filled path into the other. Raises at render time if either icon is not a filled path (seemorphable?/1)."crossfade_rotate"— crossfade and rotate the two icons. Works for any pair."auto"(default) — morph when both icons are compatible, otherwise crossfade.
Adding an icon
Icons are automatically read and generated from the icons folder. To add an icon, simply add a SVG file to the folder. File names are
required to be alphanumeric. Hyphens in the file name are automatically substituted to underscores.
Summary
Functions
Returns the concatenated SVG path data (the d attribute) for an icon name.
Whether an icon can be morphed (it is a filled-path icon). Stroked or
non-currentColor icons fall back to a crossfade transition.
Functions
Returns the concatenated SVG path data (the d attribute) for an icon name.
Whether an icon can be morphed (it is a filled-path icon). Stroked or
non-currentColor icons fall back to a crossfade transition.