Button

Stable
Hover effects & click sounds work only in client components. In Next.js, add "use client" at the top to enable them.

A button component with multiple variants, sizes, and states for various use cases.

Import

TypeScript React
import { Button } from "laxod";

Variants

Buttons come in different variants for different use cases.

Button Variants

Sizes

Buttons are available in three different sizes.

Button Sizes

With Icons

Add icons to the left or right side of the button text.

Buttons with Icons

States

Buttons can be in loading or disabled states.

Button States

Effects

Buttons can also have fancy effects

Button Effects

Full Width

Make the button take up the full width of its container.

Full Width Button

Props

PropTypeDefaultDescription
childrenReactNode-Content to display in the button
variant"primary" | "secondary" | "success" | "destructive" | "warning" | "flat" | "outline""primary"Visual style of the button
size"sm" | "md" | "lg""md"Size of the button
leftIconReactNode-Icon to display on the left
rightIconReactNode-Icon to display on the right
loadingbooleanfalseShow loading state
disabledbooleanfalseDisable the button
fullWidthbooleanfalseMake button full width
hoverEffectboolean-Enable hover effect on the button
newTabbooleanfalseOpen link in a new tab (only if href is provided)
asElementType-Render the button as a different element or component
classNamestring""Additional classes to style the button
onClick(e: SyntheticEvent) => void-Callback when the button is clicked
hrefstring-Render button as a link
targetAnchorHTMLAttributes["target"]-Target for the link (e.g., "_blank")
relAnchorHTMLAttributes["rel"]-rel attribute for links
typeButtonHTMLAttributes["type"]"button"Button type ("button" | "submit" | "reset")
aria-labelstring-Accessibility label for the button