BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/adrianub/button

button

adrianub/button
FreeComponent

adrianub publishes no description for this item.

Live preview

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

Install it

npx shadcn@latest add https://ui.adrianub.dev/r/styles/new-york/button.json

Source

ui/button.tsui.adrianub.dev/r/styles/new-york/button.json
1import type { VariantProps } from 'class-variance-authority'
2
3import { computed, Directive, input } from '@angular/core'
4
5import { cva } from 'class-variance-authority'
6import { cn } from '~/lib/utils'
7
8export const buttonVariants = cva(
9 'inline-flex items-center justify-center 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',
10 {
11 variants: {
12 variant: {
13 default:
14 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
15 destructive:
16 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
17 outline:
18 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
19 secondary:
20 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
21 ghost: 'hover:bg-accent hover:text-accent-foreground',
22 link: 'text-primary underline-offset-4 hover:underline',
23 },
24 size: {
25 default: 'h-9 px-4 py-2',
26 sm: 'h-8 rounded-md px-3 text-xs',
27 lg: 'h-10 rounded-md px-8',
28 icon: 'h-9 w-9',
29 },
30 },
31 defaultVariants: {
32 variant: 'default',
33 size: 'default',
34 },
35 },
36)
37
38type ButtonProps = VariantProps<typeof buttonVariants>
39
40export type UbButtonSize = NonNullable<ButtonProps['size']>
41export type UbButtonVariant = NonNullable<ButtonProps['variant']>
42
43@Directive({
44 selector: '[ubButton]',
45 standalone: true,
46 host: {
47 '[class]': 'computedClass()',
48 },
49})
50export class UbButtonDirective {
51 readonly class = input<string>()
52
53 readonly variant = input<UbButtonVariant>('default')
54
55 readonly size = input<UbButtonSize>('default')
56
57 protected computedClass = computed(() =>
58 cn(
59 buttonVariants({
60 variant: this.variant(),
61 size: this.size(),
62 class: this.class(),
63 }),
64 ),
65 )
66}

Files it writes

  • ui/button.ts

Facts

Registry
adrianub
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-01
Last confirmed
today

Go to the source

Docs on adrianub ui.adrianub.dev adrian-ub/shadcn-ng on GitHub Raw registry item This item as JSON

More from adrianub

All 23 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionadrianubComponentsFree1 dep
alertalertadrianubComponentsFreeno deps
aspect-ratioaspect-ratioadrianubComponentsFree1 dep
avataravataradrianubComponentsFree1 dep
badgebadgeadrianubComponentsFreeno deps
breadcrumbbreadcrumbadrianubComponentsFreeno deps
cardcardadrianubComponentsFreeno deps
collapsiblecollapsibleadrianubComponentsFree1 dep
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