Icon
Renders the given icon as a decorative SVG — always aria-hidden and
non-focusable, with a fixed 1.5 stroke width.
Usage
import { Icon, ICON_SIZE_CLASS, IconProps, IconSize } from "@desk/ui/components/icon";Best practices
Route every lucide/SVG glyph through
Icon(<Icon icon={ArrowRight} />), never the raw component — it fixes the1.5stroke and size scale so icons stay consistent.Iconis alwaysaria-hidden+ non-focusable — pair it with visible text or give the interactive parent anaria-label; never rely on it to name a control.Size with the
sizetoken ("sm","lg"…), notclassName="size-6"— the scale maps to the sharedComponentSizesteps other components align to.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | IconComponent | Icon component from lucide-react or any SVG React component. | |
| size | IconSize | Size scale for icons. Supports ComponentSize plus "3xs" for tiny icons. Defaults to |
Also exports
- const
ICON_SIZE_CLASS - interface
IconProps - type
IconSize
Composition
Used by
Accordion, AttributeCard, Badge, Button, CheckboxCardGroup, Combobox, Command, ContextMenu, DataGrid, DataGridColumnFilter, DocumentList, DropdownMenu, Empty, FileUploadDropzone, IconBox, IconCard, IconMorph, InputCard, InputGroup, LocationInput, MenuItem, Menubar, MobileNavigationRoot, NativeSelect, NavigationMenu, ProductCard, PromptPanel, RequirementItem, ResizablePanelGroup, SegmentedControl, Select, Sidebar, Toaster, Stepper, Swatch, TabNavigation, Tabs, Tag, TagSelector, ThinkingLoader, Toggle, ToggleGroup