Skip to main content

Button

Usage

variant

import Button from '@mavvy/m3-ui/Button';

...

<Button variant="outlined">outlined</Button>
<Button variant="elevated">elevated</Button>
<Button variant="filled" color="primary">filled</Button>
<Button variant="text">text</Button>
<Button variant="fab">fab</Button>

size

<Button size="small">small</Button>
<Button>medium</Button>
<Button size="large">large</Button>

color

See Color Reference

<Button color="primary" variant="outlined">primary</Button>
<Button color="primary" variant="filled">primary</Button>
<Button color="primary" variant="elevated">primary</Button>

Custom Example

  <Button
icon=""
variant="elevated"
color="tertiary"
className="!bg-error"
iconClassName="!text-sky-400 after:content-['token'] group-hover:after:!content-['fullscreen\_exit'] group-hover:!text-orange-400 group-hover:rotate-45 !text-4xl group-active:scale-75 group-active:!text-blue-700"
size="medium"
reversed
>
Elevated Custom
</Button>

Preview

Props

proptypedescription
variantoutlined|elevated|filled|text|fabbutton variant. default text
sizesmall|medium|largebutton size. default medium
colorcolorbutton color
disabledbooleandisables the button
verticalbooleanarrangement of icon and button text on y axis
reversedbooleanif true - reversed ararngement of icon and text
classNamestringclassName of the button container
styleobjectstyle of the button container
textClassNamestringclassName of the button's Text component
iconClassNamestringclassName of the button's Icon component
stateClassNamestringclassName of the button's state div
iconstringicon name
iconVariantIconVariantvariant of the icon
buttonAttrsobjectprops to override or extend the button props
textAttrsobjectprops to override or extend the button's Text component props
iconButtonbooleanrender button as icon button - no text will be shown
selectedbooleanset button as selected
selectablebooleanset button as selectable
RenderComponentReact Componentrender a react component as children of the button

Reference

Material 3 Button Reference