Skip to content
GitHub
Browse the docs

Building blocks

Button

A plain button in three weights: primary for the one action that matters in a section, secondary for the other choices, ghost for a quiet action inside another surface. An agent presses it by its words; data-agent-confirm keeps a person's step for the person.

The person sees

Nothing pressed yet.

Install
booki_version=$(npm view @booki-aui/react@latest version) &&
ui_sdk_version=$(npm view "@booki-aui/react@$booki_version" peerDependencies.@ui-sdk/core) &&
pnpm add --save-exact "@booki-aui/core@$booki_version" "@booki-aui/react@$booki_version" "@booki-aui/styles@$booki_version" \
  "@ui-sdk/core@$ui_sdk_version" "@ui-sdk/react@$ui_sdk_version"

Usage example

JSX
import { Button } from "@booki-aui/react"

<Button onClick={saveDraft}>Save draft</Button>
<Button variant="secondary" data-agent-confirm="Sending a payment needs a person">
  Send payment
</Button>
<Button variant="ghost" size="sm">Copy</Button>

An agent presses Save draft by its words. A press on Send payment waits for a person. type defaults to button, so neither submits a form by accident.

Import from @booki-aui/react. For Booki's default styling, add import "@booki-aui/styles".