Skip to content
GitHub
Browse the docs

Building blocks

Icon button

IconButton

A button that shows an icon and is named by what it does. The label is its name and tooltip, so the agent presses it by those words.

The person sees

Loading preview…

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 { IconButton } from "@booki-aui/react"
import { TrashIcon } from "@booki-aui/icons/react"

<IconButton
  label="Delete line 2"
  icon={<TrashIcon />}
  data-agent-confirm="Deleting a line needs a person"
  onClick={deleteLine}
/>

The button is named "Delete line 2" for people and the agent. The agent presses it by that name, and the confirm mark sends the press to a person.

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