JGuang

Floating Panel

Floating Panel · Chakra UI

Preview
npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0

Floating Panel

Used to render a draggable, resizable panel that floats above the page content.

Check drag boundaries, size limits, title actions and closing. Use stable identifiers for multiple panels and prevent content from becoming permanently unreachable.

Included icon notices

The source viewer includes ICON_ATTRIBUTION.md and original notices for the icon collections used by these examples. Preserve them when redistributing examples; react-icons' wrapper license does not replace individual collection terms.

  • Lucide: ISC

Installation and initialization

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0

Initialize ChakraProvider with defaultSystem and Emotion before rendering. Preserve the host React version and inspect peer compatibility. Official npm installation supplies components, not these example source files. Use the resource setup guide for locale, next-themes and framework-specific SSR; copy the selected example source separately from npm installation.

Complete native usage example

This is the actual pinned example, not a generic API mock. Copy its source closure and retain the named export. Additional imports are listed per example below.

"use client"

import { Button, FloatingPanel, IconButton, Portal } from "@chakra-ui/react"
import {
  LuGripHorizontal,
  LuMaximize2,
  LuMinus,
  LuSquare,
  LuX,
} from "react-icons/lu"

export const FloatingPanelBasic = () => {
  return (
    <FloatingPanel.Root>
      <FloatingPanel.Trigger asChild>
        <Button variant="outline" size="sm">
          Open Panel
        </Button>
      </FloatingPanel.Trigger>
      <Portal>
        <FloatingPanel.Positioner>
          <FloatingPanel.Content>
            <FloatingPanel.Header>
              <FloatingPanel.DragTrigger>
                <LuGripHorizontal />
                <FloatingPanel.Title>Floating Panel</FloatingPanel.Title>
              </FloatingPanel.DragTrigger>
              <FloatingPanel.Control>
                <FloatingPanel.StageTrigger stage="minimized" asChild>
                  <IconButton variant="ghost" size="2xs">
                    <LuMinus />
                  </IconButton>
                </FloatingPanel.StageTrigger>
                <FloatingPanel.StageTrigger stage="maximized" asChild>
                  <IconButton variant="ghost" size="2xs">
                    <LuSquare />
                  </IconButton>
                </FloatingPanel.StageTrigger>
                <FloatingPanel.StageTrigger stage="default" asChild>
                  <IconButton variant="ghost" size="2xs">
                    <LuMaximize2 />
                  </IconButton>
                </FloatingPanel.StageTrigger>
                <FloatingPanel.CloseTrigger asChild>
                  <IconButton variant="ghost" size="2xs">
                    <LuX />
                  </IconButton>
                </FloatingPanel.CloseTrigger>
              </FloatingPanel.Control>
            </FloatingPanel.Header>
            <FloatingPanel.Body>
              <p>Drag the header to move this panel around.</p>
            </FloatingPanel.Body>
            <FloatingPanel.ResizeTriggers />
          </FloatingPanel.Content>
        </FloatingPanel.Positioner>
      </Portal>
    </FloatingPanel.Root>
  )
}

All examples and reproduction requirements

Names identify demos, not component variant props. Copy every sourceFiles entry for the selected example. The compositions alias denotes local files, not a package. Preserve relative imports or rewrite the alias to your project's actual path. React peers are inspected separately; editor examples retain the coherent pinned Tiptap extension family.

Basic

floating-panel-basic · Named export FloatingPanelBasic · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-basic.tsx

Controlled Open

floating-panel-controlled-open · Named export FloatingPanelControlledOpen · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-controlled-open.tsx

With Store

floating-panel-with-store · Named export FloatingPanelWithStore · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-with-store.tsx

Stages

floating-panel-stages · Named export FloatingPanelStages · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-stages.tsx

Multiple

floating-panel-multiple · Named export FloatingPanelMultiple · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-multiple.tsx

With Overlay

floating-panel-with-overlay · Named export FloatingPanelWithOverlay · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-with-overlay.tsx

Context

floating-panel-context · Named export FloatingPanelContext · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-context.tsx

Disable Drag

floating-panel-disable-drag · Named export FloatingPanelDisableDrag · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-disable-drag.tsx

Disable Resize

floating-panel-disable-resize · Named export FloatingPanelDisableResize · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-disable-resize.tsx

Resize Axes

floating-panel-resize-axes · Named export FloatingPanelResizeAxes · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-resize-axes.tsx

Min Max

floating-panel-min-max · Named export FloatingPanelMinMax · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-min-max.tsx

Anchor Position

floating-panel-anchor-position · Named export FloatingPanelAnchorPosition · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-anchor-position.tsx

Boundary

floating-panel-boundary · Named export FloatingPanelBoundary · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-boundary.tsx

Controlled Position

floating-panel-controlled-position · Named export FloatingPanelControlledPosition · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-controlled-position.tsx

Controlled Size

floating-panel-controlled-size · Named export FloatingPanelControlledSize · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-controlled-size.tsx

Prevent Overflow

floating-panel-prevent-overflow · Named export FloatingPanelPreventOverflow · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-prevent-overflow.tsx

Rtl

floating-panel-rtl · Named export FloatingPanelRtl · original upstream example

npm install @chakra-ui/react@3.37.0 @emotion/react@11.14.0 react-icons@5.6.0
  • vendor/apps/compositions/src/examples/floating-panel-rtl.tsx

Native API and source references

The source viewer retains original declarations, imports and inheritance. Ark UI event contracts, Chakra style props and recipe types stay in their native packages; this guide does not flatten or invent their defaults. Code comments remain original source, not translated prose.

  • npm/@chakra-ui/react@3.37.0/dist/types/components/floating-panel/floating-panel.d.ts
  • npm/@chakra-ui/react@3.37.0/dist/types/components/floating-panel/index.d.ts
  • npm/@chakra-ui/react@3.37.0/dist/types/components/floating-panel/namespace.d.ts

State and installation checks

Run strict types, the target production build and real interactions. Test labels/focus/keyboard, both themes, narrow layout, empty/loading/error states where supported and cleanup after unmount. Remote demo endpoints, uploads and downloads are constrained in the preview; configure your own services. Copying a command or reaching preview-ready does not prove installation or backend success.

Provenance and license boundaries

https://github.com/chakra-ui/chakra-ui/tree/2e7517745cff2fcde0b8012f136cf99611ff262a

These are JGuang practical bilingual notes, not a full translation of upstream MDX. Original documentation and example bytes remain in vendor. Preserve repository MIT, compositions ISC metadata and separate dependency notices. The original metadata discrepancy and any missing full notices remain explicit review items; paid Chakra Pro is excluded.