Get started
Forms
- 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
Display
- 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
Layout
The tight grid for paired and triplet inputs in a property panel, with any number of columns.
Installation#
bash
pnpm dlx shadcn@latest add @zui/panel-field-groupThe CLI writes components/layout/panel-field-group.tsx and installs Utils.
Usage#
tsx
import { PanelFieldGroup } from '@/components/layout/panel-field-group';tsx
<PanelFieldGroup cols={2}>
<Field>
<FieldLabel nativeID="x">X</FieldLabel>
<Input aria-label="X" aria-labelledby="x" defaultValue="0" />
</Field>
<Field>
<FieldLabel nativeID="y">Y</FieldLabel>
<Input aria-label="Y" aria-labelledby="y" defaultValue="0" />
</Field>
</PanelFieldGroup>Omit cols for one column. Use it for paired or tripled inputs (X + Y, W + H) in a property panel; for a single
row that also needs a trailing action, wrap it in Panel row.
API reference#
PanelFieldGroup#
Takes every prop of React Native's View, plus:
| Prop | Type | Default |
|---|---|---|
cols | number | 1 |
It lays its children in rows of cols, each child in an equal share of its row, 8px apart, and the rows 4px apart.
A short last row is filled with empty cells, so the columns line up. className styles the group.
Differences from the web#
- React Native has no grid, so a
grid-cols-*class does not replace the columns; setcols. - The web writes
colsto a--colsvariable instyle; herestylegoes to the group as given.