# SbIcon Renders SVG icons from the Sufi Icons library with support for sizing, coloring, and accessibility features. Can also render custom SVG content. ## Parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Name | string? | null | Icon name from the Sufi Icons library (e.g., "home" or "si-home") | | Size | SbSize | Md | Icon size (Sm, Md, Lg, Xl) | | Color | SbColor? | null | Icon color. When null, inherits from parent via currentColor | | AriaLabel | string? | null | Accessible label. When set, icon becomes semantic (role="img") | | Mirror | bool | false | Mirrors icon in RTL layouts (for directional icons) | | Class | string? | null | Additional CSS classes | | Style | string? | null | Inline styles | | AdditionalAttributes | Dictionary? | null | Additional HTML attributes | ## Templates / Slots | Slot | Type | Description | |------|------|-------------| | CustomContent | RenderFragment? | Custom SVG or content (takes precedence over Name) | ### Template Usage ```razor ``` ## CSS Classes - `sb-icon` - Base class - `sb-icon--sm` - Small size - `sb-icon--md` - Medium size - `sb-icon--lg` - Large size - `sb-icon--xl` - Extra large size - `sb-icon--primary` - Primary color - `sb-icon--secondary` - Secondary color - `sb-icon--success` - Success color - `sb-icon--warning` - Warning color - `sb-icon--danger` - Danger color - `sb-icon--mirror` - Mirrored for RTL ## Accessibility - **Decorative icons** (no `AriaLabel`): Uses `aria-hidden="true"` to hide from screen readers - **Semantic icons** (with `AriaLabel`): Uses `role="img"` and `aria-label` for screen readers ## Examples ### Basic Icons ```razor ``` ### Sizes ```razor ``` ### Colors ```razor ``` ### Inheriting Color ```razor @* Icon inherits the parent's text color *@ Favorite Save ``` ### Accessible Icons ```razor @* Decorative icon (hidden from screen readers) *@ Save Document @* Semantic icon (announced by screen readers) *@ @* Icon-only button with accessible label *@ ``` ### RTL Mirror ```razor @* Arrow icons that should flip in RTL layouts *@ ``` ### Custom SVG Content ```razor ``` ### In Buttons ```razor Add Item Download ``` ### In Navigation ```razor Dashboard Users ``` ### Status Indicators ```razor Active Pending Failed ``` ### Loading State ```razor ``` ### Icon List ```razor ```