Rendered by GPUI’s web backend from the real component. Requires a browser with WebGPU.
sheet.rs presents existing Dialog
content at a chosen window edge, defaulting to a full-height right panel:
Sheet::new("session-settings", &dialog, &fields_scroll, "Session settings", palette)
.side(SheetSide::Right)
.description("Choose the session's drawing and toolbar settings.")
.child(form_fields)
.footer(
DialogClose::new(&dialog)
.trigger(|button| button.child("Done")),
)Keep the Sheet mounted under gpui_deck::Root while closed. The application
owns and retains both the supplied Entity<DialogState> and ScrollHandle.
Configure initial focus on that existing DialogState and use its open and
close methods. Dialog continues to own modal focus containment, Escape and
backdrop dismissal, and return focus. The Sheet adds no open state or selection
model. Its title and optional description provide both the visible header and
the underlying Dialog's accessible name and description.
The preferred width is palette.dialog_width, limited to the viewport width.
The default popup fills the viewport height, has square corners, and uses one
border on its left edge. The header and optional footer stay outside a single
vertical ScrollArea body. Each .child(...) goes into that body, whose padding,
spacing, and scrollbar colors come from the consumer palette. The body takes
the remaining height and uses the application's retained scroll handle. On
reopening, native reveal of the initial focus target can adjust its offset.
The consumer must keep the header and footer's combined content within the
viewport height. Long form content belongs in the scrolling body.
Use .side(SheetSide::Left | Right | Top | Bottom) to choose an edge. Left/right
fill the height and use palette.dialog_width as preferred width; top/bottom fill
the width and use that token as preferred height. Both dimensions are capped at
the viewport. Styled overrides apply after edge defaults, so .w(...) changes a
vertical panel's preferred width and .h(...) a horizontal panel's height,
regardless of builder order. Retain the viewport caps and flex layout. All sides
keep the same fixed header/footer and scrolling body. Drag gestures and transition
animation are outside this recipe; Drawer owns its drag interaction.
The catalogue's Forms section opens the current session help from all four edges using one retained DialogState and ScrollHandle. Closing restores the chosen trigger. The help text and session values stay application-owned.
The application supplies footer controls, including any DialogClose and its
disabled state. Keyboard interaction stays with the supplied controls and
Dialog's existing Tab containment. ScrollArea reveals focused descendants on
its enabled axis and provides native pointer scrolling; it adds no independent
scroll focus target or scroll-key bindings.
Both appearances now use Sheet for the existing Session settings form. The example reuses its DialogState, initial name-input focus, body scroll handle, Preferences/Help/Schedule/Presets sections, and Done validation rule. Compact keeps TabList/Tab/TabPanel in a 22 rem Sheet. Settings supplies a 46 rem preferred width and uses Sidebar with the selected named Region. Both widths remain capped by the viewport; the wider presentation gives navigation and form content room to sit beside one another. Closing and reopening keeps the same input, selection, and table state. The existing Edit triggers and menu/command actions open that state; the recipe adds no separate selection. Avatar and AspectRatio still render the retained preset in its HoverCard preview. Search commands and Reset preview keep their centered Dialog and AlertDialog presentations. The example caps its deferred Select, Combobox, Calendar, and Help popup widths against the window as well; those surfaces do not inherit the Sheet's width cap.