Migrating
to v3 will provide a lot more
design,
size,
color and
customisation options.
Migrating Button components can broadly described in these points:
No need to wrap your text inside Text component anymore.
isDisabled prop can be used to disable the button.
Icons in Button:
leftIcon and rightIcon are the new alternative to iconLeft and iconRight respectively and they accept tsx.Element.
Colors of the Buttons:
In v3 the color is controlled by colorScheme prop. So all the color providing props [ light, info, success, warning, danger and dark ] can be passed as value (and more) to colorScheme props.
Design of the Button:
With v3 we're providing some most frequently used designs as variants [ solid, outline, ghost, link and unstyled ] and lot more customisation.
Sizes of the Button:
In v3 the size is controlled by size prop. And it accepts pre-defined sizes [ like xs, sm md, lg ] and also custom values.
Besides option like light, info, success, warning, danger and dark. Now you can also provide colors like red, blue, cyan, teal and a lot more.
<Button success>
<Text>Success</Text>
</Button>
Besides option like light, info, success, warning, danger and dark. Now you can also provide colors like red, blue, cyan, teal and a lot more.
<Button small primary>
<Text>Default Small</Text>
</Button>
With v3 you can combine variants and style props to create various designs.
<Button bordered success>
<Text>Success</Text>
</Button>
<Button transparent success>
<Text>Success</Text>
</Button>
<Button rounded success>
<Text>Success</Text>
</Button>
With v3 iconLeft and iconRight can now accepts tsx.Element as child and render the element at the appropriate place.
<Button iconLeft dark>
<Icon name="cog" />
<Text>Settings</Text>
</Button>