separator
zard/separatorFreeComponent
@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/separator.jsonSource
1import {2 booleanAttribute,3 ChangeDetectionStrategy,4 Component,5 computed,6 input,7 ViewEncapsulation,8} from '@angular/core';910import type { ClassValue } from 'clsx';1112import { mergeClasses } from '@/shared/utils/merge-classes';1314import { separatorVariants, type ZardSeparatorVariants } from './separator.variants';1516@Component({17 selector: 'z-separator',18 template: '',19 changeDetection: ChangeDetectionStrategy.OnPush,20 encapsulation: ViewEncapsulation.None,21 host: {22 'data-slot': 'separator',23 '[attr.data-orientation]': 'zOrientation()',24 '[attr.role]': 'zDecorative() ? "none" : "separator"',25 '[attr.aria-orientation]': '!zDecorative() && zOrientation() === "vertical" ? "vertical" : null',26 '[class]': 'classes()',27 },28 exportAs: 'zSeparator',29})30export class ZardSeparatorComponent {31 readonly zOrientation = input<ZardSeparatorVariants['zOrientation']>('horizontal');32 readonly zDecorative = input(true, { transform: booleanAttribute });33 readonly class = input<ClassValue>('');3435 // shadcn/ui uses div through SeparatorPrimitive. We don't use div, so we need to add 'block' class36 // to make it match shadcn/ui styling37 protected readonly classes = computed(() => mergeClasses(separatorVariants(), 'block', this.class()));38}
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 |
