Skip to content
WunderUI

Floating Panel

Pro

A window beside the page for work that runs alongside it, such as notes, a chat or a file viewer. It floats, docks to the side, goes full screen or shrinks to a bar in the corner, and the page stays usable behind it.

Playground

Product sync

Drag the header or use the arrow keys on it, resize at the corner. Escape minimises the panel to the bar in the corner.

Installation

Floating Panel comes with WunderUI Core and Pro, in the package from your plan. See the plans.

Then import what you need:

tsx
import {
  FloatingPanel,
  FloatingPanelBody,
  FloatingPanelHeader,
  FloatingPanelHeaderProps,
  FloatingPanelMode,
  FloatingPanelProps,
} from "@wunderui/react"

Actions

Your icon buttons sit before the mode buttons: dock or float, full screen, minimise and close. Keep them to one or two.

Product sync

Size

The panel opens at 400 × 480 in the bottom-right corner. The corner handle resizes it down to minSize, and it never grows past the window.

Product sync

Anatomy

The parts the component is made of. Each one renders a you can target from CSS.

Meeting notes

Saved to WunderUI · Product sync

  • A dialog fixed to the viewport, rendered into the document body. Floating it is a 16 px rounded card with the xl shadow, 400 × 480 in the bottom-right corner; docked it fills the height at the end edge; full screen it covers the window and holds focus; minimised it becomes a bar.

  • data-slot="floating-panel-header"

    A 48 px row with the title, your actions and the mode buttons. FloatingPanel renders it from ; render your own only without .

  • data-slot="floating-panel-handle"

    The title area. While floating it moves the panel with the pointer, or with the arrow keys when focused (16 px, Shift 64 px), and announces the new position.

  • Ghost icon buttons, size sm: dock or float, full screen or exit full screen, minimise and close. The icons are the IconProvider roles dock, undock, expand, collapse, minimize and close.

  • data-slot="floating-panel-body"Optional

    The scrolling content with 16 px padding.

  • data-slot="floating-panel-resize"

    A 24 px button in the bottom-right corner while floating. Drag it or use the arrow keys; the size stays between minSize and the window.

  • data-slot="floating-panel-bar"

    A 44 px bar 16 px from the bottom-right corner with the title (restores the panel) and a close button. The panel's content stays mounted while minimised.

  • data-slot="floating-panel"
  • data-slot="floating-panel-restore"Optional

Best practices

  • When to use

    Use a Floating Panel for work that runs beside the page and is visited more than once: notes, a chat, a viewer. For a task that blocks the page use a Dialog; for a detail view tied to one row use a Sheet.

  • Do

    Give it a short title. It names the dialog for screen readers and labels the minimised bar.

  • Do

    Pass a storageKey when the panel is reopened often, so it comes back where the person left it.

  • Do

    Keep drafts in the panel's content: minimising keeps it mounted, closing unmounts it.

  • Don’t

    Don't open several floating panels at once; minimised bars sit in the same corner and cover each other.

  • Don’t

    Don't put a second close or minimise button in actions; the header already has them.

  • Do

    Inside a themed frame, pass container (an element in the frame) so the frame's CSS variables reach the panel and its bar; barClassName and barStyle style the minimised bar.

API reference

One table per part, in the order of the anatomy. Every part also takes the props of the Base UI part it wraps (such as , and ) and the native attributes of its element.

A dialog fixed to the viewport, rendered into the document body. Floating it is a 16 px rounded card with the xl shadow, 400 × 480 in the bottom-right corner; docked it fills the height at the end edge; full screen it covers the window and holds focus; minimised it becomes a bar.

PropTypeDefaultDescription
actionsReactNode—Extra header buttons, placed before the mode buttons.
barClassNamestring—Classes for the minimised bar (the panel itself takes ).
barStyleCSSProperties—Inline style for the minimised bar, e.g. the same CSS variables as the panel's .
childrenReactNode—The panel's content, usually a FloatingPanelBody. Without , start with your own FloatingPanelHeader.
containerHTMLElement | null—Where the panel and its minimised bar render (a portal). Default . Pass an element inside your frame so the frame's CSS variables and scoped styles reach them; while it is (a ref not set yet) nothing renders.
defaultMode"floating" | "docked" | "fullscreen" | "minimized""floating"Mode on first render when uncontrolled. Default .
defaultOpenbooleantrueOpen on first render when uncontrolled. Default true.
defaultPositionPoint—Top-left corner in viewport pixels while floating. Default: the bottom-right corner, 16 px from the edges.
defaultSizeSizeDEFAULT_SIZESize while floating (the width also applies when docked). Default 400 × 480.
minSizeSizeMIN_SIZESmallest size the corner handle allows. Default 320 × 240.
mode"floating" | "docked" | "fullscreen" | "minimized"—Controlled mode.
onModeChange(mode) => void—
onOpenChange(open) => void—
openboolean—Controlled open state.
storageKeystring—Remembers position, size and mode in localStorage under this key.
titleReactNode—Heading of the panel (also its accessible name and the label of the minimised bar).

A 48 px row with the title, your actions and the mode buttons. FloatingPanel renders it from ; render your own only without .

PropTypeDefaultDescription
title requiredReactNode—
actionsReactNode—Extra buttons before the mode buttons (keep them to icon buttons, size sm).
modesreadonly Exclude<FloatingPanelMode, "minimized">[]["floating", "docked", "fullscreen"]Mode buttons to offer. Default all three.

The scrolling content with 16 px padding.

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

MCPget_component("floating-panel")
InstallIncluded in Core and Pro

The full library index for assistants is at /llms.txt.