Button is the primary component for communicating actionable elements to users.
Use the variant
prop to switch between button styles. Buttons support hover, active, and disabled states.
variant
filled
Outlined
base
hover
active
disabled
<Button variant='filled'>Filled</Button>
<Button variant='outlined'>Outlined</Button>
Pass the fullWidth
prop and the button will fill its container's width.
<Button fullWidth>Componentry</Button>
Pass a startIcon
or endIcon
to add a Button icon element.
<Button startIcon='github'>Componentry</Button>
children
ReactNode
color
Button variant color
"primary"
disabled
Disables the element, preventing mouse and keyboard events
boolean
endIcon
Icon positioned after button content
string | Element
fullWidth
Toggles full width element layout
boolean
href
HTML element href
string
size
Sets the display size
"small" | "large"
startIcon
Icon positioned before button content
string | Element
variant
Display variant
"filled" | "outlined"
wrapWhenDisabled
Indicates whether buttons in a disabled state should be wrapped with a span
boolean
You can use module augmentation to customize the TypeScript types for any of Button's props:
declare module 'componentry/types/components/Button/Button' {
interface ButtonPropsOverrides {
// ... overwrite any types for Button props ...
}
}
See the TypeScript guide for more information.
.C9Y-Button-DisabledWrapper
.C9Y-Button-Icon
.C9Y-Button-Icon-largeSize
.C9Y-Button-Icon-smallSize
.C9Y-Button-base
.C9Y-Button-filled
.C9Y-Button-largeSize
.C9Y-Button-outlined
.C9Y-Button-smallSize