Detail drawer
Components: Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerBody, DrawerResizeHandle, Attribute, AttributeLabel
+30 more
AttributeValue, Heading, Separator, HStack, VStack, Tabs, TabsList, TabsTrigger, TabsContent, TabsLineActions, NumericBadge, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, Button, InlineCodeSnippet, Tag, FormatDateTime, Table, EmptyState, EmptyStateMessage, EmptyStateTitle, Alert, AlertContent, AlertTitle, AlertControls, Tooltip, Dialog
A detail drawer is a Drawer with no footer. It shows one entity as Attribute rows, titled sections and an optional nested Table.
When to use
Rules
Drawer
- Mount one controlled
Drawer(open,onOpenChange) for the list. Never one per row. - Open it from the list
TableonMasterCellClick; mark the row withactiveRowId. Row-menu clicks do not open it. - Keep the last entity in state after close so content does not blank. To reset state after close, use
onExitComplete: it fires once the exit animation ends. - Pass
width={640}. Use 700 (the Figma frame) only if design confirms it.widthis read once on mount. - If resizable, put
DrawerResizeHandlefirst inDrawerContent(400–1130px). - Never add a
DrawerFooteror your own close button. - In tests, pass
data-testidtoDrawer. Never select bydata-slot.
Header actions
- One
DropdownMenuinDrawerHeader, triggerButton variant='outline' color='neutral' size='small'"Actions" +ChevronDown. - Order: edit, state changes, "Go to …" links,
DropdownMenuSeparator, destructive items. - Destructive items use
variant='destructive'and name the entity: "Delete provider". - Keep the built-in 12px before the close X, though Figma shows 4px.
Spacing
DrawerBodyowns the 24px gutter. Never pad inside it or passclassNametoDrawerHeader/DrawerBody.- Attribute rows:
VStack gap={6} className='pb-8'. Sections:Separator spacing={4}. Never aSeparatoraboveTabs:TabsListdraws its own line. - Section header:
HStack justify='between' align='center' className='py-8',Heading as='h3' size='md' weight='medium', optionalButton size='small'. - Full-width tabs:
<div className='-mx-24'>aroundTabsList, not itsclassName. Table 16px from the edge:<div className='-mx-8'>aroundTable, never on it. No other negative margins.
Attributes
- Always pass
orientation='horizontal'; the default is vertical. - One
AttributeLabelwidthper drawer: 140 matches Figma; up to 256 for long labels. Never wrap a label. - Two columns:
grid grid-cols-2 gap-x-8 gap-y-6, default label width. - Section help: an
Infoicon in aTooltipafter the heading.
InlineCodeSnippet copies on click; copyable={false} turns that off.
Tabs and tables
- Keep
TabsinDrawerBodyto scroll with the attributes. Pinned tabs:Tabs asChildaroundDrawerHeader,TabsList,DrawerBody(DrawerWithTabsstory); attributes then go in eachTabsContent. - Tab action:
Button size='small'inTabsLineActions. - Nested tables follow Entity table. Never use
TableActionBarin a drawer: it renders underneath.
Does not exist: DRAWER_SIZES, a size prop on Drawer, DrawerActions, DrawerHeaderActions, AttributeGroup, AttributeList, DescriptionList, a section component, fullBleed on TabsList or Table.
Examples
The list opens one shared drawer from the master cell.
Click a provider name: one shared, non-modal drawer opens and the row stays marked. The header has a single "Actions" menu; the body has horizontal attributes (a code value, a secret, a timestamp), then full-width tabs with counts, each with an inset nested table. Google Workspace has no rules, so its table keeps the headers and shows a short empty state.
The drawer shell with a resize handle and the header actions menu.
Drag the left edge to resize between 400 and 1130px; onResizeEnd gets the final width to
persist. The close X comes built in, so there is no footer and no close button of your own.
Attribute rows with a code value, a secret, a missing value and a timestamp.
Every row is horizontal with the same 140px label. Entra ID has no default role, so that row stays and shows the empty marker; the codes copy on click.
A section with a title and an action.
The first group needs no title. Each later group starts with a Separator and a header row; the
action applies to that section only.
Full-width tabs with a count and an inset nested table that stays visible when empty.
Google Workspace has no rules yet: the table keeps its headers and shows a one-line empty state with no action, since "Create rule" already sits on the tab line.
States
The entity is loading.
The entity is still loading: every Attribute shows its skeleton and the nested table shows
three skeleton rows. No Loader over the body, and the header keeps its title.
Viewing an old version.
Viewing an old version: an info Alert comes first in the body with "Back to current" and
"Restore", and the header "Actions" menu is disabled until the reader goes back.
What your app owns
Related
- Complex drawer for events with charts, Entity table, Resource list page
- Create and edit forms, Confirmation dialogs
- Action-result toasts, Empty states
- Spacing, Layering