Icon.
One contract. Your choice of character.
Consistent size, semantic color and accessible naming for the SVG icons you already use. Keep each pack’s artwork and install only what your application needs.
Make it yours
Preparing the example…
A place to start
UsageImport the stylesheet once at your application root. This complete example reflects the properties selected above.
Loading example…
Details that make a difference
Examples & statesChange packs without changing size or color roles. Named image gives the SVG an accessible name; leave decoration unnamed inside a labeled button. Explore the Icons foundation for composition and supported-pack examples.
The finer details
API referenceGenerated from Dixy’s local TypeScript interfaces. Native HTML attributes and refs are forwarded. The table covers Dixy’s own options.
Icon
| Prop | Type / description | Default |
|---|---|---|
render* | ReactElement<SVGProps<SVGSVGElement>>One SVG element or SVG icon component. Pack-specific props belong here. | — |
size | IconSizeThe existing icon sizing token. Button children inherit their control's icon size unless explicitly set. | md |
color | IconColorA semantic icon foreground, or the surrounding text/control color. | inherit |
label | stringAccessible name for a meaningful standalone image. Omit for decorative icons. | — |
Built from the same foundations
Styling tokensChange Theme settings above to compare appearance, accent, neutral, radius, spacing density, motion and direction. Override component aliases on a Theme root so custom properties follow portaled content too. The wrapper merges className, style, refs and render composition with its owning primitive.
| Token | Purpose |
|---|---|
--dixy-size-icon-md | The component-specific starting point. |
--dixy-font-label-md | Control label font and line height; body roles remain readable in text inputs. |
--dixy-color-background-selected | Selected surfaces use semantic color across appearances. |
--dixy-color-border-focus | Focus indication remains visible independently of shadows. |
--dixy-spacing-inset-sm | Density-aware component padding. |
--dixy-motion-transition-feedback | Short state feedback, reduced by the inherited motion setting. |
Consider everyone
AccessibilityIcons are decorative and hidden from assistive technology by default. Supply label for a meaningful standalone image. Put an action’s accessible name on IconButton; keep its child Icon decorative. Color never replaces status text. Icon itself is not a keyboard control.
Target: WCAG 2.2 AA. Automated tests cover selected behavior; manual screen-reader, contrast, and zoom validation remain part of the release checklist.
Build it. Then understand it.
The design system owns the visual and accessibility contract. The icon pack owns SVG geometry, fill, stroke and pack-specific props. render composition preserves SVG refs, events and viewBox without adding a wrapper or a runtime network dependency.
--dixy-size-icon-md