progress
zard/progressFreeComponent
@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/progress.jsonSource
1import { ChangeDetectionStrategy, Component, computed, input, ViewEncapsulation } from '@angular/core';23import type { ClassValue } from 'clsx';45import { mergeClasses } from '@/shared/utils/merge-classes';67import { progressVariants } from './progress.variants';89@Component({10 selector: 'z-progress',11 template: `12 <div13 data-slot="progress-indicator"14 class="bg-primary size-full flex-1 transition-all"15 [style.transform]="indicatorTransform()"16 ></div>17 `,18 changeDetection: ChangeDetectionStrategy.OnPush,19 encapsulation: ViewEncapsulation.None,20 host: {21 'data-slot': 'progress',22 role: 'progressbar',23 'aria-valuemin': '0',24 'aria-valuemax': '100',25 '[attr.aria-valuenow]': 'clampedValue()',26 '[class]': 'classes()',27 },28 exportAs: 'zProgress',29})30export class ZardProgressComponent {31 readonly value = input(0);32 readonly class = input<ClassValue>('');3334 protected readonly clampedValue = computed(() => {35 const v = this.value();36 if (v > 100) return 100;37 if (v < 0) return 0;38 return v;39 });4041 protected readonly indicatorTransform = computed(() => `translateX(-${100 - this.clampedValue()}%)`);4243 protected readonly classes = computed(() => mergeClasses(progressVariants(), this.class()));44}
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 | |
| badgebadge | @zard | Components | Free | no deps · 3 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 |
