BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/@example/react/button

button

example-react/button
FreeComponent

@example/react publishes no description for this item.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/jsrepojs/jsrepo/main/examples/react/public/r/shadcn/button.json

Source

button.tsxraw.githubusercontent.com/jsrepojs/jsrepo/main/examples/react/public/r/shadcn/button.json
1import type React from 'react';
2import { tv, type VariantProps } from 'tailwind-variants';
3import { cn } from '@/registry/lib/utils';
4
5export const buttonVariants = tv({
6 base: 'flex items-center rounded-md active:scale-98 transition-all',
7 variants: {
8 variant: {
9 default: 'bg-primary text-primary-foreground',
10 destructive: 'bg-destructive text-destructive-foreground',
11 outline: 'border border-border hover:bg-accent',
12 },
13 size: {
14 default: 'h-8 px-2.5',
15 sm: 'h-7 px-2',
16 },
17 },
18});
19
20export type Variant = VariantProps<typeof buttonVariants>['variant'];
21export type Size = VariantProps<typeof buttonVariants>['size'];
22
23export function Button({
24 variant = 'default',
25 size = 'default',
26 className,
27 ...props
28}: React.ComponentProps<'button'> & { variant?: Variant; size?: Size }) {
29 return <button {...props} className={cn(buttonVariants({ variant, size }), className)} />;
30}

What it pulls in

npm packages

  • react@19.2.0

Other registry items

  • utils

Files it writes

  • button.tsx
  • page.tsx

Facts

Registry
@example/react
Type
registry:ui
Access
Free
Files written
2
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

jsrepo.dev jsrepojs/jsrepo on GitHub Raw registry item This item as JSON
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