Components

Button

Triggers an action or event. Supports multiple variants, color roles, sizes, loading and disabled states, icon slots, and a polymorphic `as` prop.

import{ Button }from"oks-ui"
3 variants7 color roles6 sizesLoading stateDisabled stateIcon supportRipple effectButtonGroup

Colors

Apply semantic color roles to communicate intent.

Sizes

Buttons are available in six sizes that scale consistently.

Loading & Disabled

Communicate pending actions or unavailable states.

With Icons

Add leading or trailing icons using startContent and endContent.

ButtonGroup

Group related buttons together horizontally.

Interactive Playground

Controls

Preview

Generated Code

<Button>Button</Button>

Props

variant"solid"

"solid" | "soft" | "bordered"

Controls the visual style of the button.

color"default"

"default" | "primary" | "secondary" | "info" | "success" | "warning" | "danger"

Semantic color role for the button.

colorDepth

50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950

Specific palette shade override.

size"md"

"xs" | "xs-sm" | "sm" | "md" | "lg" | "xl"

Controls the button dimensions and font size.

radius"md"

"none" | "xs" | "xs-sm" | "sm" | "md" | "lg" | "full"

Border radius override. Inherits from context.

shadow"none"

"none" | "xs" | "xs-sm" | "sm" | "md" | "lg"

Shadow depth for the button.

isDisabledfalse

boolean

Disables the button and prevents interaction.

isLoadingfalse

boolean

Shows a loading spinner and disables interaction.

isIconOnlyfalse

boolean

Renders as a square icon button. Requires aria-label.

fullWidthfalse

boolean

Stretches the button to fill its container width.

disableAnimationfalse

boolean

Opt out of all animation effects.

disableRipplefalse

boolean

Disables the ripple effect on press.

href

string

If provided, renders as an <a> element.

startContent

ReactNode

Content rendered before the button label.

endContent

ReactNode

Content rendered after the button label.

type"button"

"button" | "submit" | "reset"

Native button type attribute.

as"button"

ElementType

Polymorphic root element. Auto-set to 'a' when href is provided.

onPress

(e: PressEvent) => void

Called when the button is pressed (click, Enter, or Space).