Skip to content

Button

An interactive element that performs an action when clicked.

import { Button } from '@ontoui/react';
<Button>Button</Button>;

Examples

Variant

Use the variant prop to control the visual style of the button.

<Button>Primary</Button>
<Button variant="secondary">Secondary</Button>

Disabled

Use the disabled prop to prevent interaction.

<Button disabled>Primary</Button>
<Button variant="secondary" disabled>Secondary</Button>

API Reference

Prop Type Default
children? string | string[]
id? string
className? string
variant? "primary" | "secondary" primary
disabled? boolean false
onClick? (event: React.MouseEvent<HTMLButtonElement>) => void
onFocus? (event: React.FocusEvent<HTMLButtonElement>) => void
onBlur? (event: React.FocusEvent<HTMLButtonElement>) => void
ref? Ref<HTMLButtonElement>