Options Panel

Anchored popover shell with header, body, and footer slots for custom controls. Footer owns gapX and gapY, with FooterActions and FooterMeta for paired actions and status copy. Prefer this over Popover when the surface needs composed controls.

Also known as: rich popover, form popover, control popover, popover with controls, tool popover, custom popover, options popover, titled popover, options sheet

Installation

Install with the CLI, or copy the component source into your project.

Add options-panel (npm)

npx --yes -p @default-file/ui df-ui add options-panel

Default

Titled panel with Toggle Group choices, Input stepper fields, Switch, FooterActions, FooterMeta, and kit Badge.

Properties

Anchored popover shell with a titled header and open body/footer slots for custom controls such as inputs, buttons, and sections. Prefer this over Popover when the surface needs composed controls. Width hugs content up to the panel max-width token and the viewport. Shares Popover dismiss behavior: Escape and outside clicks close, and focus returns to the trigger.

OptionsPanel

Root open state. Same API as Popover.

PropTypeDefaultNotes
openboolean-Controlled open state.
defaultOpenboolean-Uncontrolled initial open state.
onOpenChange(open: boolean) => void-Called when open state changes.

OptionsPanelTrigger

PropTypeDefaultNotes
renderReactElement-Host element that toggles the panel.
childrenReactNode-Trigger content when not using render.

OptionsPanelContent

Panel shell. Sizes to content, capped by --df-options-panel-max-width and the viewport. Defaults to end align and bottom side.

PropTypeDefaultNotes
side"top" | "bottom" | "left" | "right""bottom"Preferred placement side. Flips when there is not enough space.
align"start" | "center" | "end" | "auto""end"Alignment along the side. auto picks the best fit from available space (content-aware).
sideOffsetnumber8Gap between trigger and panel.
matchTriggerWidthbooleanfalseLock the panel to the trigger width. Off by default so the panel sizes to its content within the max-width cap.
portalbooleantrueWhen false, render the panel inline for docs demos. The body hugs content with no height clamp. Default portals to document.body and keeps the body max-height scroll contract.
classNamestring-Override or extend panel chrome. Use width or max-width utilities when a call site needs a different size than the token default.
childrenReactNode-Compose OptionsPanelHeader, OptionsPanelBody, and OptionsPanelFooter.

OptionsPanelHeader

Header region with bottom border. Usually wraps the title.

PropTypeDefaultNotes
classNamestring-Additional styles on the header.
childrenReactNode-Usually OptionsPanelTitle.

OptionsPanelTitle

Panel title text.

PropTypeDefaultNotes
childrenReactNode-Title copy.
classNamestring-Additional styles on the title.

OptionsPanelBody

Body slot. Hugs content width. Never scrolls horizontally. Portaled panels clamp height with --df-options-panel-max-height and use the kit ScrollArea when content is taller. Inline panels (portal false) size to content with no scroll clamp.

PropTypeDefaultNotes
fitbooleanfalseSize the body to its content with no max-height scroll clamp. Default keeps the portaled height cap and vertical kit scroll.
classNamestring-Additional styles on the body.
childrenReactNode-Panel controls and content.

Tokens

Theme defaults live on :root. Override these globally or on a local host.

TokenTypeDefaultNotes
--df-options-panel-max-widthCSS lengthvar(--df-max-w-xs)Maximum panel width. The shell grows with content up to this cap and the viewport. Content wraps. The body does not scroll sideways.
--df-options-panel-max-heightCSS length520pxMaximum panel height before scrolling.
--df-options-panel-footer-gap-xCSS lengthcalc(2 * var(--spacing-unit))Horizontal gap for FooterActions and FooterMeta. Set by gap or gapX.
--df-options-panel-footer-gap-yCSS lengthcalc(2.5 * var(--spacing-unit))Vertical gap between stacked footer rows. Set by gap or gapY.
--popoverCSS colorvar(--df-neutral-0)Panel fill.
--popover-foregroundCSS colorvar(--df-neutral-900)Panel text color.