DocsAPI ReferenceComponents<Drawer>

<Drawer>

A vertical or horizontal list of items that can be dragged into a <Puck.Preview>. Used for composing custom Puck UIs.

Interactive Demo
Orange
import { Puck, Drawer } from "@measured/puck";
 
export function Editor() {
  return (
    <Puck>
      <Drawer>
        <Drawer.Item name="Orange" index={0} />
      </Drawer>
    </Puck>
  );
}

Props

ParamExampleTypeStatus
childrenchildren: <Drawer.Item />ReactNodeRequired
directiondirection: "horizontal"horizontal, vertical-
droppableIddroppableId: "my-drawer"String-

Required props

children

A React node representing the contents of the <Drawer>. Will likely contain <Drawer.Item> nodes.

Optional props

direction

Set the direction of the drawer.

Defaults to vertical.

droppableId

Set a custom ID for the underlying Droppable.

  • Must be unique.
  • Will be prefixed with component-list:.

Defaults to default.