Button
The foundational button component with multiple variants, sizes, and full Radix UI Slot support for polymorphic usage. Designed to be the workhorse of your UI with consistent styling and accessible interaction.
form@radix-ui/react-slotclass-variance-authority
Installation
$npx futureuikit add button
Import
import { Button } from "@/components/ui/button"
Layout Variant
Color Theme
Size
Shape
Spacing
Named Keys & Props
Pass these exact named keys as props on <Button />. Click any color pill to copy the prop.
colorDefault is "default"(Black & White)variantVisual style"solid""outline""ghost""link"shapeCorner shape"default""square""rounded""sharp"spacingInner spacing"default""2x""4x""6x""8x"sizeComponent size"sm""md""lg""icon"Usage Example
A basic implementation example to get you started.
Example Implementation
import { Button } from "@/components/ui/button";
import { Mail } from "lucide-react";
export default function Example() {
return (
<div className="flex flex-wrap gap-4 items-center">
<Button variant="solid" color="default">Button</Button>
<Button variant="solid" color="indigo">Indigo Solid</Button>
<Button variant="outline" color="emerald" size="sm">Small Outline</Button>
<Button variant="ghost" color="blue" size="icon"><Mail /></Button>
<Button variant="link" color="violet" asChild>
<a href="/login">Login with Link</a>
</Button>
</div>
);
}Features
Key capabilities and highlights.
Key Capabilities
- ◆Supports layout variants: solid, outline, ghost, and link.
- ◆Four size options: sm, md (default), lg, and icon.
- ◆Shape options: default, square, rounded, and sharp.
- ◆Full 10-color palette support mapped to interactive states.
- ◆Spacing variants included to adjust gap distances seamlessly.
- ◆Full asChild support via Radix UI Slot for flexible component composition.
- ◆Highly accessible with built-in focus states and disabled handling.
Notes
Important implementation details to consider.
Implementation Details
- ◆Install: Run'npx futureuikit add button'to install the component and Radix UI Slot dependency.
- ◆Import:'import { Button } from "@/components/ui/button";'
- ◆Variants & Colors: Combine 'variant' ('solid', 'outline', 'ghost', 'link') with any of the 10 named 'color' keys.
- ◆Sizes: Adjust scaling via'size'('default','sm','lg','icon').
- ◆Polymorphism: Use'asChild'to render as a custom link component (like'next/link') while preserving styles.