Skip to main content

Button

A pressable button with six visual variants and five sizes, all token-driven.

Playground​

Get started
<Button
variant="solid"
size="md"
tone="primary"
label="Get started"
onPress={() => {}}
/>

Variants​

Solid
Subtle
Surface
Outline
Ghost
Plain
<Button variant="solid" label="Solid" onPress={() => {}} />
<Button variant="outline" label="Outline" onPress={() => {}} />

Sizes​

XS
Small
Medium
Large
XL

Loading & disabled​

Loading
Disabled
Pill
<Button label="Loading" isLoading onPress={() => {}} />
<Button label="Disabled" isDisabled onPress={() => {}} />
<Button isPill label="Pill" onPress={() => {}} />

Props​

PropTypeDefaultDescription
labelstringRequired. Button text.
onPress() => voidPress handler (inherited from Pressable).
variant'solid' | 'subtle' | 'surface' | 'outline' | 'ghost' | 'plain''solid'Visual style.
tone'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info''primary'Re-points the variant's accent color, e.g. tone="error" for destructive actions. plain and surface keep their neutral text color.
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'Padding, radius, and label font scale.
isDisabledbooleanfalseDisables interaction and dims opacity.
isLoadingbooleanfalseShows a spinner in place of (or alongside) the label.
isPillbooleanfalseForces fully rounded corners regardless of size.
loading{ position?: 'start' | 'end'; label?: string; loader?: ReactNode }Customize the loading state.
labelPropsOmit<TTextProps, 'color' | 'variant'>Extra props passed to the internal label Text.
leftIconTVajraIconComponentIcon rendered before the label.
rightIconTVajraIconComponentIcon rendered after the label.

Also accepts all Pressable props (bg, borderColor, spacing, etc.) except disabled; use isDisabled instead.