Button
Uses a native button to preserve form behavior and keyboard interaction. Provides five variants and four sizes, with an inset shadow representing the pressed state.
@neumorphism-ui/buttonPreview
Installation
Installation: button
npx shadcn@latest add @neumorphism-ui/buttonThe CLI resolves npm dependencies, base tokens, utilities, and component source in order.
New to this Registry? Set up the namespace before continuing.
Usage
Import
Button import code
import { Button } from "@/components/ui/button"Example
Button usage code
<div className="flex gap-3"> <Button variant="primary">Save changes</Button> <Button variant="soft">Cancel</Button> <Button variant="ghost">Later</Button> <Button size="icon" aria-label="Add item">+</Button> </div>
API Reference
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
Button | variant | "default" | "primary" | "soft" | "ghost" | "destructive" | "default" | Selects the button meaning and degree of surface emphasis. |
Button | size | "sm" | "default" | "lg" | "icon" | "default" | Selects the height and horizontal padding. |
Button | type | "button" | "submit" | "reset" | "button" | Determines the native button behavior. |
Button | disabled | boolean | false | Disables pointer and keyboard interaction. |
Accessibility
- 01
Because it uses a native button, Space and Enter behavior and disabled semantics are preserved.
- 02
Always provide an aria-label that describes the action of an icon-size button.
- 03
For navigation, use a semantic anchor or Link instead of a Button click handler.