@stesura/icons
The editor’s icon system: icon components drawn from a swappable icon set. StesuraEditor picks
the set with its iconSet prop (see Theming); custom
toolbar UI imports the same components (BoldIcon, TableIcon, …) so its icons follow the set.
Icon sets
Both sets define the same names, so a set is chosen once and every icon follows. classicIcons
lives on its own subpath, so only apps that pick it ship it.
fluentIcons
export const fluentIcons: IconSet;Microsoft Fluent geometry, with the accent/fill layer variables. The default set.
classicIcons
export const classicIcons: IconSet; // from '@stesura/icons/classic'The original Stesura icons, gaps filled with lucide. Its own subpath (@stesura/icons/classic) so only apps that pick it ship it.
IconSet
export type IconSet = Record<string, IconData>;Icon geometry keyed by semantic name (bold). Both built-in sets define the same names, so a set is chosen once (via IconProvider) and every icon follows; call sites never name a set.
Provider
IconProvider
Supplies the default tier and icon set. Nesting is additive: an inner
provider that only sets tier keeps the outer set, which is what lets
EditorButtonLarge change the tier without knowing anything about sets.
| Name | Type | Default |
|---|---|---|
__0 | IconProviderProps |
IconProviderProps
IconProvider’s props: either value, unset ones inherited from an outer provider.
IconContextValue
What IconProvider supplies to the icons below it.
Icon components
createIcon
Builds an icon component for a semantic name. Geometry is resolved per render from the active set, so switching sets re-renders every icon without touching a single call site.
| Name | Type | Default |
|---|---|---|
key | string |
IconProps
Icons accept the usual SVG props on top of the geometry controls, so they
can be used as tooltip/menu triggers — Base UI’s render prop injects
handlers, refs and ARIA attributes onto whatever element it is given.
| Export | What it is |
|---|---|
BorderIcon | Border-picker icon drawn from options (top, bottom, left, right, horizontal, vertical) rather than set geometry. Props: BorderIconProps |
ReactIcon | The React logo, outside the sets. Props: ReactIconProps (SVG props plus size) |
Geometry
For building a custom IconSet: geometry keyed by the same semantic names as the built-in sets.
IconData
A single-tier icon keeps its geometry inline; a two-tier icon supplies
tiers. Icons gain a 24 tier as Fluent geometry is vendored in.
IconGeometry
An icon’s SVG geometry at one tier.
IconNode
export type IconNode = [string, IconNodeAttrs, IconNode[]?];One SVG element of an icon’s geometry: [tag, attrs, children?].
IconNodeAttrs
An IconNode’s SVG attributes, with color given as layers rather than literal paints.
IconLayer
export type IconLayer =
| "outline-primary"
| "outline-secondary"
| "accent-primary"
| "accent-secondary"
| "accent-tertiary"
| "fill-primary"
| "fill-secondary"
| "fill-tertiary"
| "constructive"
| "destructive"
/** Brand marks: not themeable, see the notes in core's stylesheet. */
| "brand-pdf"
| "brand-word";Semantic color role for a path. The name carries the paint channel:
outline-* paints stroke, everything else paints fill. A path that
needs both sets layer (stroke) and fillLayer (fill).
IconTier
export type IconTier = 16 | 24;Rendering tiers. 16 = EditorButton / context menus; 24 = EditorButtonLarge, which pins its icons to 24px.