Comma Agents
@comma-agents/tuiComponents

Button

Interactive button with focus, hover, click, and disabled state support.

Button

An interactive button rendered as [ Label ]. Supports keyboard focus (Enter), mouse clicks (left/right), hover highlighting, and a disabled state.

Must be rendered inside a <Frame> (or any component mounting <MouseProvider>) for mouse events.

import { Button } from "@comma-agents/tui";

<Button
  id="confirm-btn"
  label="Confirm"
  variant="primary"
  onPress={() => console.log("Confirmed!")}
/>

<Button
  label="Delete"
  variant="danger"
  onPress={handleDelete}
  disabled={isDeleting}
/>

ButtonProps

PropTypeDefaultDescription
idstring--Ink focus id; when omitted, manages its own focus zone
labelstring--Text label inside the button
variantButtonVariant"primary"Visual variant
onPress() => void--Activation callback
disabledbooleanfalseDisables interaction and dims the button

Variants

VariantDescription
primaryPrimary accent color
secondarySecondary/muted
dangerError/red
ghostDimmed, minimal

Interaction

ActionBehavior
Tab / Shift+TabNavigate focus between buttons
Enter (focused)Fire onPress
Left click (button 0)Focus then fire onPress
Right click (button 2)Fire onPress without stealing focus

Focus and hover both highlight with inverse text style. Disabled buttons are dimmed and suppress all interactions.

On this page