A trigger opens a panel that people drag by its header, size by its edges, and minimize or close.
layers-panel.tsx
FloatingPanel
| Prop | Type | Default | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| on | — | Called when the panel opens or closes, with the Base UI details (the reason, cancel). On a phone the details are the ones of the Drawer. | |||||||||||||||||
| children | ReactNode | — | |||||||||||||||||
| stage | "default""maximized""minimized" | — | The stage: default (its own rect), minimized (the header pill), maximized. | ||||||||||||||||
| default | "default""maximized""minimized" | "default" | The stage at mount when stage is not set. Default default. | ||||||||||||||||
| on | — | ||||||||||||||||||
| position | — | The place in px from the top left corner of the boundary (controlled). | |||||||||||||||||
| default | — | The place at the first open. Default: the center of the boundary. | |||||||||||||||||
| on | — | Called after a drag settles, a key move, or a resize from a top or left edge. | |||||||||||||||||
| size | — | The size in px (controlled). | |||||||||||||||||
| default | FLOATING_PANEL.size | The size at the first open. Default 320 × 360. | |||||||||||||||||
| on | — | Called after a pointer or key resize. | |||||||||||||||||
| min | FLOATING_PANEL.minSize | The smallest size of a resize. Default 200 × 120. | |||||||||||||||||
| max | — | The largest size of a resize. Default: the boundary. | |||||||||||||||||
| boundary | FloatingPanelBoundary | "viewport" | Where the panel may go: "viewport" (default, fixed) or a ref to an element (absolute in it: give it position: relative). At least 48px of the header always stays inside. | ||||||||||||||||
| draggable | boolean | true | Move by the grip. Default true. Off: no grip, the title starts 12px in. | ||||||||||||||||
| resizable | boolean | true | Resize from the edges. Default true. | ||||||||||||||||
| resize | readonly FloatingPanelEdge[] | FLOATING_PANEL_EDGES | The edges that resize. Default all 8. | ||||||||||||||||
| close | boolean | true | Escape closes the front panel. Default true. A panel behind the front one never closes. | ||||||||||||||||
| persist | string | — | Saves the place, the size, and the stage under this key for the next visit. Off by default. | ||||||||||||||||
| labels | — | The words of the controls. | |||||||||||||||||
From Base UIDialog.RootBase UI docs | |||||||||||||||||||
| open | boolean | — | Whether the dialog is currently open. | ||||||||||||||||
| default | boolean | false | Whether the dialog is initially open. To render a controlled dialog, use the open prop instead. | ||||||||||||||||
| on | — | Event handler called after any animations complete when the dialog is opened or closed. | |||||||||||||||||
| |||||||||||||||||||
FloatingPanelTrigger
<button>| Prop | Type | Default | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||
From Base UIDialog.TriggerBase UI docs | |||||||||||||||||||||
| handle | DialogHandle<unknown> | — | A handle to associate the trigger with a dialog. Can be created with the Dialog.createHandle method. | ||||||||||||||||||
| payload | unknown | — | A payload to pass to the dialog when it is opened. | ||||||||||||||||||
| id | string | — | ID of the trigger. In addition to being forwarded to the rendered element, it is also used to specify the active trigger for the dialog in controlled mode (with the DialogRoot triggerId prop). | ||||||||||||||||||
| |||||||||||||||||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||||||||||||||||
FloatingPanelContent
<div>| Prop | Type | Default | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||
From Base UIDialog.PopupBase UI docs | ||||||||||
| initial | — | Determines the element to focus when the dialog is opened. By default, focus moves to the first tabbable element inside the popup, except when the dialog is opened by touch — then the popup itself is focused to avoid opening the virtual keyboard. - false: Do not move focus. - true: Move focus based on the default behavior (first tabbable element or popup). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, null to fall back to the default behavior, or false/undefined to do nothing. | ||||||||
| final | — | Determines the element to focus when the dialog is closed. - false: Do not move focus. - true: Move focus based on the default behavior (trigger or previously focused element). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, null to fall back to the default behavior, or false/undefined to do nothing. | ||||||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | ||||||||
| ||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||
FloatingPanelHeader
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FloatingPanelDragHandle
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | — | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | — | |||||
| children | ReactNode | — | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
FloatingPanelTitle
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FloatingPanelDescription
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FloatingPanelControls
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FloatingPanelStageTrigger
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | — | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | — | |||||
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| stage | "maximized""minimized" | — | The stage this control goes to: minimized (Minimize, then Expand) or maximized. | ||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
FloatingPanelClose
<div>FloatingPanelBody
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FloatingPanelFooter
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| Arrow keys | On the grip: moves the panel 10px. On a resize edge: changes the size. |
|---|---|
| ShiftArrow keys | On the grip: moves the panel 50px. |
| HomeorEnd | On the grip: moves the panel to the start or the end edge of the boundary. |
| Escape | Closes the front panel. |
Built with
Installs with Floating Panel











