Palette

import { Palette } from '@hanzo/ui/product'

No examples yet.

Types

export type PaletteProps = {
open: boolean
onOpenChange: (open: boolean) => void
/** Everything runnable, local commands and route commands alike. */
ops: Op[]
/** Run one. The surface decides what running it means. */
onRun: (op: Op) => void
/**
* The highlighted row's id (controlled). A surface drawing a preview beside the
* list needs to know what is highlighted.
*/
active?: string
onActive?: (id: string) => void
/** The typed query. Uncontrolled unless a surface wants to read it. */
search?: string
onSearch?: (search: string) => void
placeholder?: string
/** Shown when nothing survives the search. */
empty?: ReactNode
/** Rows per group. See `survivors` — a render budget, not a preference. */
limit?: number
/** The right-hand panel. Absent, the list takes the full width. */
children?: ReactNode
/** The bar along the bottom — key hints, usually. */
footer?: ReactNode
/** How tall the list is. It scrolls inside this. */
height?: number
/** The dialog's accessible name. */
title?: string
/**
* Take whatever was typed and answer it, when the list cannot.
*
* Supplied, the bar ends with one "Ask AI: …" row for any non-empty query, so
* a search that matches nothing is a question rather than a dead end. Absent,
* the bar behaves exactly as it did — a surface with nothing to ask does not
* grow a row that goes nowhere.
*/
onAsk?: (question: string) => void
}

Exports

Palettetype PaletteProps