Button
The Button component is a versatile and customizable button that can be used for various actions in your application. It supports different variants, sizes, icons, and can be used as a link.
Installation
Import the component:
import { Button } from "@/components/ui/Button"
Basic Usage
Basic examples showing different button configurations including variants and icons.
Button Variants
Different visual styles to match your UI needs.
Button Sizes
The Button component comes in three sizes to suit different use cases.
Border Radius
Customize the button's border radius to match your design.
Loading State
Display a loading state while processing an action.
Props
variant'default' | 'secondary' | 'outline' | 'ghost' | 'link'Visual style variant
size'sm' | 'default' | 'lg'Button size
rounded'none' | 'sm' | 'full'Border radius style
asChildbooleanRender children directly using Radix UI Slot
iconLucideIconIcon component to render
iconPosition'left' | 'right'Icon position
hrefstringURL for link buttons
openInNewTabbooleanWhether to open link in new tab
loadingbooleanShows loading spinner
classNamestringAdditional CSS classes
childrenRequiredReactNodeThe content to display inside the button