Skip to content
GitHub
Browse the docs

Building blocks

Agent cursor

AgentCursor

The agent’s pointer rings a control when reading and presses it when editing. It follows the target as the page moves.

The person sees

Run the agent: its pointer glides to the amount, rings it, and the value changes.

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 { AgentCursor, createAgentCursor, createBookiAgent } from "@booki-aui/react"

const cursor = createAgentCursor()
export const agent = createBookiAgent({ allow: cursor.wrap(allow) })

// Once, in the app shell:
<AgentCursor cursor={cursor} />

Before each step the pointer glides to the control, rings it and presses; then your allow decides. It follows reduced motion.

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