Primary Button
A fully modern and customizable primary button designed for high-end UI. It features semantic intents (primary, success, warning, danger, info, secondary) and multiple visual styles (modern, clean, minimal). Built with Framer Motion for organic interactions, it supports disabled states and full color customization.
formframer-motion
Installation
$npx futureuikit add primary
Import
import { PrimaryButton } from "@/components/ui/primary-button"
Layout Variant
Shape
Spacing
Icons
Named Keys & Props
Pass these exact named keys as props on <PrimaryButton />. Click any color pill to copy the prop.
colorDefault is "default"(Black & White)variantVisual style"primary""secondary""success""danger""warning""info""ghost""link""outline"shapeCorner shape"default""square""rounded""sharp"spacingInner spacing"default""2x""4x""6x""8x"Usage Example
A basic implementation example to get you started.
Example Implementation
import { PrimaryButton } from"@/components/ui/primary-button";
export default function Example() {
return (
<form onSubmit={(e) => e.preventDefault()} className="grid grid-cols-2 gap-4">
{/* Simple Variant usage */}
<PrimaryButton variant="primary"type="submit">Submit Form</PrimaryButton>
<PrimaryButton variant="success">Success Action</PrimaryButton>
{/* Full accessibility & standard attributes support */}
<PrimaryButton
variant="danger"
onFocus={() => console.log('Focused!')}
aria-label="Delete item"
>
Delete
</PrimaryButton>
{/* Styling modes */}
<PrimaryButton variant="info" color="sky">Sky Info</PrimaryButton>
{/* Native disabled state */}
<PrimaryButton disabled>Cannot Click</PrimaryButton>
</form>
);
}Features
Key capabilities and highlights.
Key Capabilities
- ◆Built with React and Framer Motion for smooth, organic interactions.
- ◆Supports semantic intents: Primary, Success, Warning, Danger, Info, and Secondary.
- ◆Supports multiple visual modes: Modern (Glass), Clean (Solid), and Minimal (Outline).
- ◆Built-in support for disabled states with appropriate styling and interaction prevention.
- ◆Fully customizable color profile via props (overrides semantic defaults).
- ◆Zero-shadow design for a clean, professional aesthetic.
- ◆Highly reusable and easy to integrate into any Next.js project.
Notes
Important implementation details to consider.
Implementation Details
- ◆Install: Run'npx futureuikit add primary'to download the component and dependencies.
- ◆Import:'import { PrimaryButton } from "@/components/ui/primary-button";'
- ◆Variants: Use the'variant'prop to switch between'primary','success','warning','danger','info', and'secondary'.
- ◆Colors: Pass any of the 10 named color keys ('default', 'blue', 'emerald', 'rose', 'amber', 'violet', 'indigo', 'sky', 'slate', 'orange') via 'color'.
- ◆Shapes & Spacing: Customize corners with 'shape' ('default', 'square', 'rounded', 'sharp') and size with 'spacing' ('default', '2x', '4x', '6x', '8x').
- ◆Standard Props: Supports all native HTML button attributes including'disabled','type', and'onClick'.