-
Notifications
You must be signed in to change notification settings - Fork 0
Button
Matt Layton edited this page Apr 13, 2020
·
2 revisions
By default, an HTML button has an implicit type of submit. Here we override that default to be button, since this is more common and often otherwise forgotten.
<Button onClick={Function.prototype}>Call to action!</Button>Styled components also ships with the as prop which in this case, for example, can allow you to render the component as a hyperlink instead of a button, whilst maintaining the button styles:
<Button as="a" href="/">Go to page!</Button>| Prop | PropType | Default | Description |
|---|---|---|---|
| type | String | "button" | HTML button type attribute |