- Label
- Icon label
- Field
- Form
- Frontmatter form
- Questionnaire
- Input
- Input group
- Input OTP
- Password input
- Password strength
- Code input
- Number field
- Tag input
- Textarea
- Checkbox
- Radio group
- Language toggle group
- Emoji appearance toggle group
- Emoji picker
- Avatar picker
- AI provider picker
- Select
- Native select
- Combobox
- Language combobox
- Slider
- Calendar
- Switch
- Alert
- Avatar
- Badge
- Card
- AI provider card
- Model info card
- Model list
- Empty
- Item
- Tree item
- File tree
- Icon media
- File type icon
- Font preview
- Image preview
- Kbd
- Table
- Data table
- Data table column header
- Chart
- Code Block
- Code card
- Markdown view
- Attachment
- Bubble
- Marker
- Message
- Chat message
- Chat suggestion item
- Message scroller
- Trace
- Progress
- Spinner
- Sonner
- Toast
- Unsaved changes toolbar
- Unsaved indicator
- Status indicator
- Permission card
- Separator
- Skeleton
- Animated grid pattern
- Meteors
A small square that holds one glyph, its background and its glyph tinted through the caller's className, announced as an image when it is given a label.
Installation#
pnpm dlx shadcn@latest add @zui/icon-mediaThe CLI writes components/general/icon-media.tsx and installs Icon,
Text and Utils.
Usage#
import { IconMedia } from '@/components/general/icon-media';<Tooltip>
<TooltipTrigger aria-label="Vision input">
<IconMedia className="bg-muted text-muted-foreground">
<Icon as={Eye} />
</IconMedia>
</TooltipTrigger>
<TooltipContent>
<Text>Vision input</Text>
</TooltipContent>
</Tooltip>It carries no meaning of its own, so one serves a model ability, a generation type or any icon the caller picks.
Give it an aria-label, or name the Tooltip trigger around it, which a
press opens. For a field's own text label, use Icon label instead.
API reference#
IconMedia#
Takes every prop of React Native's View. The design system ships no tint for it; the caller's className
supplies the colours. Its text classes, such as text-muted-foreground, go to the Icon and Text inside it, since
a View draws no text colour, and the rest style the square. An Icon inside it with no size-* class of its own
is drawn at size-3. With an aria-label it is one element for a screen reader, announced as an image.
Differences from the web#
- The web sizes any child
svg; the native square sizes an Icon, which takes the size through its container. - The web tooltip opens on hover; on a device the tooltip trigger around it opens on a press.