Blazor playground

Nova v3.37.0

Preview

Blazor

Drawer

nv-drawer

A panel that slides in from the side of the screen for details or a secondary task, while the page stays in view behind it.

Parts
Guides

Live demo

Side
Size

Use a drawer for details or a secondary task, such as settings or a longer form, when people should keep the page in view. For a short decision that must interrupt the flow, use a dialog. While a drawer is open, the page behind it is covered and can't be used.

Dialog or drawer

Choose a dialog for an immediate decision and a drawer for contextual details, settings or a longer sequence of steps. The design also describes drawers without an overlay. This implementation always uses a modal overlay: the underlying page remains visible but is not interactive. There is no showOverlay property.

Anatomy

A drawer on the right of a dimmed overlay, with a title, subtitle, message, and Cancel and Apply actions. Callouts mark 1 the header, 2 the body, 3 the footer, 4 the close button and 5 the overlay.

The parts of a drawer.
  1. Header (nv-drawerheader): a title and an optional subheading.
  2. Body: the default slot. It scrolls when the content is long.
  3. Footer (nv-drawerfooter): a cancel and a primary action.
  4. Close button: removed with undismissable, which also turns off Escape.
  5. Overlay: closes the drawer when clicked only with clickOutside.

Sizes

SizeTypical content
smA few details or a short settings task.
mdA form or a moderate amount of contextual information.
lgA complex layout or several related steps.
fullA task needing the available viewport width.

size controls width for the implemented left and right drawers. The design mentions horizontal drawers where supported; top and bottom drawers are not available in this component. Use width for an application-specific width.

Look and feel

Spark and Ocean style the same header, scrollable body, footer and overlay. Keep the side panel visually connected to the page it supplements.

Customising the sections

The header slot accepts a title, icons or contextual controls, and the footer slot accepts custom actions or step navigation. Body content goes in the default slot, not a named body slot. Design the body for flexible height and scrolling; keep its main actions in the footer so long content does not push them out of reach.

Placement and closing

side puts the drawer on the left or right (the default), and size sets its width: sm, md (the default), lg or full. A button in the trigger slot opens the drawer; with controlled, your application opens it through open. Escape and the close button update open. A slotted nv-drawerfooter emits drawerCanceled: an uncontrolled, dismissible drawer then closes itself. A controlled drawer stays open until your handler changes open. The primary action emits drawerPrimaryClicked and never closes the drawer automatically.

The design's dismissible option maps to the inverse of undismissable. If you remove the close button, provide a clear way to complete the task. Preserve the drawer's accessible title when supplying a custom header; autofocus is an optional way to focus the first control on opening.

Sources