⌘ K

Button

Actions with clear hierarchy and accessible interaction states.

Interactive playground

LIVE PREVIEW

Props

Visual hierarchy.

Control size.

Button label.

Disable interactions.

Show a spinner and disable interactions.

Fill the available width.

Generated code
import { Button } from '@vrum/ui';

<Button
  variant={"primary"}
  size={"md"}
  disabled={false}
  isLoading={false}
  fullWidth={false}
>
  {"Create project"}
</Button>
Copy code

Button props

PropTypeDefaultDescription
variant"destructive" | "primary" | "secondary" | "outline" | "ghost" | "link""primary"Visual hierarchy.
size"xs" | "sm" | "md" | "lg" | "2lg" | "3lg" | "icon""md"Control size.
iconOnlybooleanfalseicon only configuration.
destructivebooleanfalsedestructive configuration.
asChildbooleanfalseas child configuration.
loadingTextstringnoneloading text configuration.
loadingbooleanfalseShow the loading state.
isLoadingbooleanfalseShow a spinner and disable interactions.
fullWidthbooleanfalseFill the available width.
leftIconReact.ReactNodenoneleft icon configuration.
rightIconReact.ReactNodenoneright icon configuration.
disabledbooleanfalseDisable interactions.
namestringnonename configuration.
type"submit" | "reset" | "button""button"type configuration.
valuestring | number | readonly string[]noneControlled value.
defaultCheckedbooleannonedefault checked configuration.
defaultValuestring | number | readonly string[]noneInitial value for an uncontrolled component.
autoFocusbooleannoneauto focus configuration.
classNamestringnoneAdditional CSS classes.
idstringnoneid configuration.
styleCSSPropertiesnoneInline style overrides.
aria-invalidboolean | "false" | "true" | "grammar" | "spelling"noneIndicates the entered value does not conform to the format expected by the application.
aria-labelstringnoneDefines a string value that labels the current element.
childrenReactNodenoneButton label.
onFocusFocusEventHandler<HTMLButtonElement>noneon focus configuration.
onBlurFocusEventHandler<HTMLButtonElement>noneon blur configuration.
onChangeChangeEventHandler<HTMLButtonElement, Element>noneCalled when the input value changes.
onSubmitSubmitEventHandler<HTMLButtonElement>noneCalled when the form is submitted.
onKeyDownKeyboardEventHandler<HTMLButtonElement>noneon key down configuration.
onClickMouseEventHandler<HTMLButtonElement>noneCalled when the control is activated.
onSelectReactEventHandler<HTMLButtonElement>noneon select configuration.