Button
fysk/buttonFreeComponent
Standard button with multiple variants with built in state handling.
Install it
npx shadcn@latest add https://fysk.dev/r/button.jsonSource
1"use client"2import * as React from "react"3import { Slot } from "@radix-ui/react-slot"4import { cva, type VariantProps } from "class-variance-authority"56import { cn } from "@/lib/utils"7import { useFyskConfig, type FyskIconPosition } from "@/components/fysk-provider"8import { useFyskAnimation } from "@/components/hooks/useFyskAnimation"910const buttonVariants = cva(11 "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none overflow-hidden active:scale-95",12 {13 variants: {14 variant: {15 default: "bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",16 outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",17 secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",18 ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",19 destructive: "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",20 link: "text-primary underline-offset-4 hover:underline",2122 glass: "bg-foreground/10 backdrop-blur-md border-border/50 text-foreground hover:bg-foreground/15 shadow-xs",23 success: "bg-green-600 text-white hover:bg-green-600/90 shadow-xs",24 warning: "bg-yellow-600 text-white hover:bg-yellow-600/90 shadow-xs",25 info: "bg-blue-600 text-white hover:bg-blue-600/90 shadow-xs",2627 "success-outline": "bg-green-500/10 border border-green-500/50 text-green-700 dark:text-green-400 hover:bg-green-500/20 shadow-xs",28// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from fysk
All 18 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Avataravatar | fysk | Components | Free | 2 deps | |
| Badgebadge | fysk | Components | Free | 1 dep | |
| Empty Stateempty | fysk | Components | Free | 2 deps | |
| Formform | fysk | Components | Free | 4 deps | |
| fysk-providerfysk-provider | fysk | Components | Free | 2 deps | |
| Inputinput | fysk | Components | Free | 1 dep | |
| Input OTPinput-otp | fysk | Components | Free | no deps | |
| Kbdkbd | fysk | Components | Free | 1 dep |
