Button
Custom button component styled using Tailwind CSS
Props#
| Prop | PropType | Description | Required | Default value |
|---|---|---|---|---|
| className | string | any Tailwind CSS class | no | |
| disabled | boolean | whether the button is disabled or not | no | false |
| label | string | text to appear inside the button | no | |
| icon | JSX.Element | a React icon component (i.e. a Heroicons component) | no | |
| iconOnly | boolean | whether to only show the icon without the label prop | no | false |
| innerRef | MutableRefObject<null> | needed to use with Headless-UI Dialog (Modal) component | no | |
| isLoading | boolean | whether to show a loading spinner when waiting for something to happen | no | false |
| onClick | () => void | onClick handler function | no | |
| priority | "primary" | "secondary" | "ghost" | "icononly" | button color fill type | no | "primary" |
| type | "button" | "submit" | "reset" | button type | yes | "button" |
Result
SyntaxError: Unexpected token (1:8)
1 : return ()
^Live Editor