Skip to main content

Button

Custom button component styled using Tailwind CSS

Props#

PropPropTypeDescriptionRequiredDefault value
classNamestringany Tailwind CSS classno
disabledbooleanwhether the button is disabled or notnofalse
labelstringtext to appear inside the buttonno
iconJSX.Elementa React icon component (i.e. a Heroicons component)no
iconOnlybooleanwhether to only show the icon without the label propnofalse
innerRefMutableRefObject<null>needed to use with Headless-UI Dialog (Modal) componentno
isLoadingbooleanwhether to show a loading spinner when waiting for something to happennofalse
onClick() => voidonClick handler functionno
priority"primary" | "secondary" | "ghost" | "icononly"button color fill typeno"primary"
type"button" | "submit" | "reset"button typeyes"button"
Result
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^
Live Editor