Command

A command palette / cmd+k style searchable list, powered by cmdk inside a sketch-bordered panel.

No results.
Pen
Pencil
Brush
Eraser
Ruler
<Command roughness={1.5}>
  <CommandInput placeholder="Search tools…" />
  <CommandList>
    <CommandEmpty>No results.</CommandEmpty>
    <CommandGroup>
      <CommandItem value="Pen">Pen</CommandItem>
      <CommandItem value="Pencil">Pencil</CommandItem>
    </CommandGroup>
  </CommandList>
</Command>

CLI install

npx doodleui-react add command

Usage

import {
  Command,
  CommandInput,
  CommandList,
  CommandEmpty,
  CommandGroup,
  CommandItem,
} from "doodleui-react";

<Command>
  <CommandInput placeholder="Search tools…" />
  <CommandList>
    <CommandEmpty>No results.</CommandEmpty>
    <CommandGroup>
      <CommandItem value="Pen">Pen</CommandItem>
      <CommandItem value="Pencil">Pencil</CommandItem>
    </CommandGroup>
  </CommandList>
</Command>

CommandSeparator (a drawn line) and CommandShortcut (a muted trailing caption) round out the set. See Combobox for a ready-made searchable select built on top of Command + Popover.

Props

PropTypeDefaultNotes
shouldFilter / filterboolean / (value, search, keywords?) => numbertrue / cmdk defaultcmdk's built-in fuzzy filtering, or bring your own.
value / onValueChangestring / (value: string) => voiduncontrolledControls the highlighted item value.
animatebooleantrueDraw-in the panel border on mount. Overrides DoodleUIProvider. Reduced motion disables this unless the provider set forceAnimate.
roughnessnumber1.5How wobbly the stroke is. 0 is almost geometric. 3+ is messy.
seednumberprovider / randomLocks the sketch. Omit to follow SketchSeedProvider (Shuffle) or a mount-time random seed.
sketchColorstring#1f1d1aStroke color. Also tints primary/accent fills where relevant.
classNamestringundefinedPassed through to the root element.
styleCSSPropertiesundefinedPassed through to the root element.