AsterUIDocsv1.0.2

Docs / Component reference

Drawer & yield* promptDrawer()

Open a task from the bottom edge of the view. The generator helper lets the caller wait for the answer.

Drawer example

Install

sh
npx @fierst/ui@1.0.2 add drawer

Registry dependencies: theme, sheet, button.

Exports from ./ui/drawer: Drawer, DrawerAction, promptDrawer.

Download the registry source for drawer 1.0.2.

API contracts

ts
export function Drawer({
  id,
  open,
  title,
  description,
  footer,
  onClose,
  class: extraClass,
  children,
}: {
  id?: string;
  open?: any;
  title?: string;
  description?: string;
  footer?: View;
  onClose?: () => void;
  class?: string;
  children?: View;
})

export interface DrawerAction {
  id: string;
  label: string;
  danger?: boolean;
}

export function* promptDrawer(opts: {
  title: string;
  description?: string;
  actions: readonly DrawerAction[];
  cancelLabel?: string;
}): Generator<View, string | null, any>