Button
A flexible button component with multiple variants and sizes.
Props
variant
- Visual style:solid
,outline
, orghost
size
- Button size:sm
,md
, orlg
fullWidth
- Make button full widthdisabled
- Disable the buttonas
- Render as a different element (e.g.,a
for links)leftIcon
- Icon component to display on the leftrightIcon
- Icon component to display on the right
Variants
With Icons
Buttons can display icons on either side using the leftIcon
and rightIcon
props:
Button as Link
Use the as
prop to render a button that looks like a button but behaves like a link:
States
TypeScript
Button is fully typed with TypeScript, including polymorphic support:
import { Button, ButtonProps } from '@beauginbey/vanilla-components';
// Type-safe props
const MyButton = (props: ButtonProps<'button'>) => {
return <Button {...props} />;
};
// With custom element
const LinkButton = (props: ButtonProps<'a'>) => {
return <Button as="a" {...props} />;
};