Button
Component Button
is an interactive button that can contain text, icons, and a loading indicator.
Anatomy
Import all parts and piece them together.
import { Button } from '@xsolla-zk/react'
export default () => (
<Button>
<Button.Icon />
<Button.Text />
<Button.Icon />
</Button>
)
Examples
Basic example
import { Button } from '@xsolla-zk/react'
function App() {
return (
<Button>
<Button.Text>Press me</Button.Text>
</Button>
)
}
All Sizes
Buttons support different sizes based on the components design system tokens:
All sizes
All Tones
Buttons support different tones based on the components theme config:
All Tones
All Variants
All Variants
API
Button Props
Buttons extend Stack views inheriting all the Tamagui standard props , plus:
Prop | Type | Default | Description |
---|---|---|---|
variant | 'primary' | 'secondary' | 'tertiary' | 'primary' | Variant of the button |
size | ButtonSizes | '$500' | Button size |
tone | ButtonTone | 'brand' | Button tone |
disabled | boolean | false | Disables the button |
isLoading | boolean | false | Shows the loading indicator |
blured | boolean | false | Applies the blur effect |
Button.Text Props
Component for displaying text inside the button.
Button.Icon Props
Component for displaying an icon inside the button.
Prop | Type | Default | Description |
---|---|---|---|
icon | React.ReactNode | - | Icon to display |
Accessibility
- Supports keyboard navigation
- Works correctly with screen readers
- Automatically manages the
disabled
state when loading