BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn/ui/button

button

accelya-ui-lib/button
FreeComponent

shadcn/ui publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by shadcn/ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/ramsaoji/Accelya-UI-Lib/main/public/r/styles/default/button.json

Source

ui/button.tsxraw.githubusercontent.com/ramsaoji/Accelya-UI-Lib/main/public/r/styles/default/button.json
1import * as React from "react"
2import { Slot } from "@radix-ui/react-slot"
3import { cva, type VariantProps } from "class-variance-authority"
4
5import { cn } from "@/lib/utils"
6
7const buttonVariants = cva(
8 "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
9 {
10 variants: {
11 variant: {
12 default: "bg-primary text-primary-foreground hover:bg-primary/90",
13 destructive:
14 "bg-destructive text-destructive-foreground hover:bg-destructive/90",
15 outline:
16 "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
17 secondary:
18 "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19 ghost: "hover:bg-accent hover:text-accent-foreground",
20 link: "text-primary underline-offset-4 hover:underline",
21 },
22 size: {
23 default: "h-10 px-4 py-2",
24 sm: "h-9 rounded-md px-3",
25 lg: "h-11 rounded-md px-8",
26 icon: "h-10 w-10",
27 },
28 },
29 defaultVariants: {
30 variant: "default",
31 size: "default",
32 },
33 }
34)
35
36export interface ButtonProps
37 extends React.ButtonHTMLAttributes<HTMLButtonElement>,
38 VariantProps<typeof buttonVariants> {
39 asChild?: boolean
40}
41
42const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
43 ({ className, variant, size, asChild = false, ...props }, ref) => {
44 const Comp = asChild ? Slot : "button"
45 return (
46 <Comp
47 className={cn(buttonVariants({ variant, size, className }))}
48 ref={ref}
49 {...props}
50 />
51 )
52 }
53)
54Button.displayName = "Button"
55
56export { Button, buttonVariants }

What it pulls in

npm packages

  • @radix-ui/react-slot

Files it writes

  • registry/default/ui/button.tsx

Facts

Registry
shadcn/ui
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
3 days ago

Go to the source

Docs on shadcn/ui ramsaoji/Accelya-UI-Lib on GitHub Raw registry item This item as JSON

More from shadcn/ui

All 357 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionshadcn/uiComponentsFree1 dep
alertalertshadcn/uiComponentsFreeno deps
alert-dialogalert-dialogshadcn/uiComponentsFree1 dep
aspect-ratioaspect-ratioshadcn/uiComponentsFree1 dep
avataravatarshadcn/uiComponentsFree1 dep
badgebadgeshadcn/uiComponentsFree1 dep
breadcrumbbreadcrumbshadcn/uiComponentsFree1 dep
calendarcalendarshadcn/uiComponentsFree2 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex