Skip to Content
✨ QuickCode UI keeps growing! More components, more features, and more ways to make your projects shine. Stay tuned & maybe… hire me or sponsor me 😉 
DocumentationButton

Button

A versatile and accessible button component with multiple variants, sizes, and states. Ideal for primary actions, secondary options, and loading indicators in forms and interfaces.

Install Dependencies

npx
quickcode-ui add Button

Default Usage

Default Button

Variants

Outline Variant

Secondary Variant

Ghost Variant

Destructive Variant

Link Variant

Sizes and Loading

Small Size

Large Size

Loading State

Props

PropTypeDefaultDescription
variant"default" | "destructive" | "outline" | "secondary" | "ghost" | "link""default"Visual style of the button, affecting background, border, and text colors.
size"default" | "sm" | "lg" | "md" | "icon""default"Controls padding, height, and overall size of the button.
isLoadingbooleanfalseShows a loading spinner and disables the button during asynchronous actions.
disabledbooleanfalseDisables the button and applies reduced opacity.
classNamestringundefinedAdditional CSS classes for custom styling overrides.
onClick() => voidundefinedOptional click handler function.
type"button" | "submit" | "reset""button"HTML button type for form submissions.
childrenReact.ReactNodeundefinedButton content, such as text or icons.
Last updated on