button
vengenceui/buttonFreeComponent
vengenceui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by vengenceui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.vengenceui.com/r/button.jsonSource
1import * as React from 'react'2import { Slot } from '@radix-ui/react-slot'3import { cva, type VariantProps } from 'class-variance-authority'45import { cn } from '@/lib/utils'67const buttonVariants = cva('cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {8 variants: {9 variant: {10 default: 'shadow-sm shadow-black/20 bg-primary text-primary-foreground hover:bg-primary/90',11 destructive: 'bg-destructive text-destructive-foreground shadow-md hover:bg-destructive/90',12 outline: 'shadow-sm shadow-black/15 border border-transparent bg-background ring-1 ring-foreground/10 duration-200 hover:bg-muted/50 dark:ring-foreground/15 dark:hover:bg-muted/50',13 secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',14 ghost: 'hover:bg-accent hover:text-accent-foreground',15 link: 'text-primary underline-offset-4 hover:underline',16 },17 size: {18 default: 'h-9 px-4 py-2',19 sm: 'h-8 rounded-md px-3 text-xs',20 lg: 'h-10 rounded-md px-8',21 icon: 'h-9 w-9',22 },23 },24 defaultVariants: {25 variant: 'default',26 size: 'default',27 },28})2930export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {31 asChild?: boolean32}3334const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(({ className, variant, size, asChild = false, ...props }, ref) => {35 const Comp = asChild ? Slot : 'button'36 return (37 <Comp38 className={cn(buttonVariants({ variant, size, className }))}39 ref={ref}40 {...props}41 />42 )43})44Button.displayName = 'Button'4546export { Button, buttonVariants }
What it pulls in
npm packages
Files it writes
More from vengenceui
All 128 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | vengenceui | Components | Free | 2 deps | |
| agent-bento-gridagent-bento-grid | vengenceui | Components | Free | 1 dep | |
| alertalert | vengenceui | Components | Free | no deps | |
| animated-buttonanimated-button | vengenceui | Components | Free | 1 dep | |
| animated-footeranimated-footer | vengenceui | Components | Free | 2 deps | |
| animated-numberanimated-number | vengenceui | Components | Free | 1 dep | |
| animated-raysanimated-rays | vengenceui | Components | Free | no deps | |
| animated-tooltipanimated-tooltip | vengenceui | Components | Free | 1 dep |
