badge
zard/badgeFreeComponent
@zard publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by @zard on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.zardui.com/r/badge.jsonSource
1import { ChangeDetectionStrategy, Component, computed, input, ViewEncapsulation } from '@angular/core';23import type { ClassValue } from 'clsx';45import { mergeClasses } from '@/shared/utils/merge-classes';67import { badgeVariants, type ZardBadgeTypeVariants } from './badge.variants';89@Component({10 selector: 'z-badge, a[z-badge]',11 template: `12 <ng-content />13 `,14 changeDetection: ChangeDetectionStrategy.OnPush,15 encapsulation: ViewEncapsulation.None,16 host: {17 '[class]': 'classes()',18 '[attr.data-variant]': 'zType()',19 'data-slot': 'badge',20 },21 exportAs: 'zBadge',22})23export class ZardBadgeComponent {24 readonly zType = input<ZardBadgeTypeVariants>('default');2526 readonly class = input<ClassValue>('');2728 protected readonly classes = computed(() => mergeClasses(badgeVariants({ zType: this.zType() }), this.class()));29}
Files it writes
More from @zard
All 49 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | @zard | Components | Free | no deps · 5 files | |
| alertalert | @zard | Components | Free | no deps · 3 files | |
| alert-dialogalert-dialog | @zard | Components | Free | no deps · 5 files | |
| avataravatar | @zard | Components | Free | no deps · 4 files | |
| breadcrumbbreadcrumb | @zard | Components | Free | no deps · 4 files | |
| buttonbutton | @zard | Components | Free | no deps · 3 files | |
| button-groupbutton-group | @zard | Components | Free | no deps · 3 files | |
| calendarcalendar | @zard | Components | Free | no deps · 7 files |
