Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

FloatingPanel

Pass a trigger, title, and body. The panel can be dragged, resized, minimized, maximized, and restored.

import { Button, FloatingPanel, Text } from '@manti-ui/react';

export default function FloatingPanelBasic() {
  return (
    <FloatingPanel trigger={<Button>Open panel</Button>} title="Layers">
      <Text emphasis="muted">
        Drag me by the header, or resize from any edge.
      </Text>
    </FloatingPanel>
  );
}

API

PropTypeDefaultDescription
triggerReactElementElement that opens the panel. Cloned with the machine trigger props.
titleReactNodePanel title shown in the header.
childrenReactNodePanel body.
draggablebooleantrueAllow dragging by the header.
resizablebooleantrueAllow edge/corner resizing.
openbooleanControlled open state.
defaultOpenbooleanInitial open state for uncontrolled usage.
onOpenChange(open: boolean) => voidCalled whenever the open state changes.

Styling

Anatomy

PartSelectorDescription
positioner[data-scope="floating-panel"][data-part="positioner"]Positions the floating panel.
content[data-scope="floating-panel"][data-part="content"]The translucent panel surface.
header[data-scope="floating-panel"][data-part="header"]The title bar, also the drag handle.
drag-trigger[data-scope="floating-panel"][data-part="drag-trigger"]The draggable region of the header.
title[data-scope="floating-panel"][data-part="title"]The panel title text.
control[data-scope="floating-panel"][data-part="control"]Wraps the stage and close buttons.
stage-trigger[data-scope="floating-panel"][data-part="stage-trigger"]Minimize, maximize, or restore the panel.
close-trigger[data-scope="floating-panel"][data-part="close-trigger"]Closes the panel.
body[data-scope="floating-panel"][data-part="body"]The scrollable panel content.
resize-trigger[data-scope="floating-panel"][data-part="resize-trigger"]An edge or corner resize handle.

Tokens

TokenControls
--manti-floating-panel-min-widthmin width
--manti-floating-panel-min-heightmin height

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub