structyl

SvgIcon

stable

A wrapper for custom SVG icons.

Basic usage

Check

Examples

Accessible icon

Provide a title when the icon communicates meaning.

Success

Decorative icon

Leave title empty when nearby text already names the action.

Size and color

Use titleAccess for MUI-style accessible titles.

SmallLarge

Features

  • Accessible title support.
  • Current-color sizing.

Installation

bash
pnpm dlx structyl add svg-icon

API Reference

SvgIcon

Current-color SVG wrapper.

PropTypeDefault
titlestring

Accessible SVG title.

titleAccessstring

MUI-style alias for title.

fontSize'inherit' | 'small' | 'medium' | 'large'

Icon size.

'medium'
color'default' | 'inherit' | 'primary' | 'secondary' | 'success' | 'warning' | 'destructive' | 'muted'

Tokenized icon color.

'inherit'
classNamestring

Additional Tailwind classes merged with the component defaults.

SVG Icon | structyl