Button
A button component that extends the HTML button element.
Import#
Button: The base button component.
Usage#
SyntaxError: Unexpected token (1:8)
1 : return ()
^Props#
colorScheme#
Use the colorScheme prop to change the colors of the button. You can use one of the built-in schemes, or pass a list of class names to create your own.
SyntaxError: Unexpected token (1:8)
1 : return ()
^size#
Use the size prop to change the size of the button. You can use one of the built-in size, or pass a list of class names to create your own.
SyntaxError: Unexpected token (1:8)
1 : return ()
^isLoading#
Use the isLoading prop to show a spinner and disable to button.
SyntaxError: Unexpected token (1:8)
1 : return ()
^isRaised#
Use the isRaised prop to add a shadow to the button.
SyntaxError: Unexpected token (1:8)
1 : return ()
^Adding icons#
Just add an SVG or a custom icon component as children to the button.
SyntaxError: Unexpected token (1:8)
1 : return ()
^Using the button as a link#
Sometimes you might want to use the button a link (the HTML a tag). This can be achieved by passing the as prop to the button. When doing so, all props for an anchor will be available to use.
SyntaxError: Unexpected token (1:8)
1 : return ()
^Accessability#
Button follows the practices for buttons found at WAI-ARIA Authoring Practices.
Buttonhas the role ofbutton.- When
Buttonhas focus,SpaceorEnteractivates it. - When
Buttonis disabled,aria-disabledis set to true.