- 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
The detail panel for one model, an identity header composed from Item parts over titled sections.
Installation#
pnpm dlx shadcn@latest add @zui/model-info-cardThe CLI writes components/data-display/model-info-card.tsx, installs Utils, and adds
class-variance-authority.
Usage#
import { ModelInfoCard, ModelInfoCardIndicator, ModelInfoCardSection } from '@/components/data-display/model-info-card';<ModelInfoCard>
<Item size="xs">
<ItemMedia>
<ProviderLogo />
</ItemMedia>
<ItemContent>
<ItemTitle>GPT-4o</ItemTitle>
<ItemDescription>OpenAI</ItemDescription>
</ItemContent>
<ItemFooter>
<Text className="text-muted-foreground font-mono text-xs">gpt-4o</Text>
</ItemFooter>
</Item>
<ModelInfoCardSection>
<Item size="xs">
<ItemMedia>
<ModelInfoCardIndicator tone="chart-2" />
</ItemMedia>
<ItemContent>
<ItemTitle>Context length</ItemTitle>
</ItemContent>
<ItemActions>
<Text>128K tokens</Text>
</ItemActions>
</Item>
</ModelInfoCardSection>
</ModelInfoCard>Use it for the detail panel of one model, such as inside a Hover card's content. Compose the header and each section's heading row from Item parts.
Composition#
ModelInfoCard
|-- Item
| |-- ItemMedia
| |-- ItemContent
| | |-- ItemTitle
| | `-- ItemDescription
| `-- ItemFooter
`-- ModelInfoCardSection
`-- Item
|-- ItemMedia
| `-- ModelInfoCardIndicator
|-- ItemContent
| `-- ItemTitle
`-- ItemActionsAPI reference#
ModelInfoCard#
Takes every prop of React Native's View: a column of the header and the sections, 12px apart.
ModelInfoCardSection#
Takes every prop of React Native's View: a titled section, its heading row over its detail lines, 6px apart.
ModelInfoCardIndicator#
Takes every prop of React Native's View, plus:
| Prop | Type | Default |
|---|---|---|
tone | 'muted' | 'chart-1' | 'chart-2' | 'chart-3' | 'chart-4' | 'chart-5' | 'muted' |
The accent bar beside a section title, in one of the theme's chart colours, or the muted foreground. It is hidden from a screen reader, which reads the title beside it.
Differences from the web#
- The web's
data-slotattributes are not set; a View takes no data attributes.