table
zard/tableFreeComponent
@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/table.jsonSource
1import { ChangeDetectionStrategy, Component, computed, input, ViewEncapsulation } from '@angular/core';23import type { ClassValue } from 'clsx';45import {6 type ZardTableSizeVariants,7 type ZardTableTypeVariants,8 tableBodyVariants,9 tableCaptionVariants,10 tableCellVariants,11 tableFooterVariants,12 tableHeaderVariants,13 tableHeadVariants,14 tableRowVariants,15 tableVariants,16} from '@/shared/components/table/table.variants';17import { mergeClasses } from '@/shared/utils/merge-classes';1819@Component({20 selector: 'table[z-table]',21 template: `22 <ng-content />23 `,24 changeDetection: ChangeDetectionStrategy.OnPush,25 encapsulation: ViewEncapsulation.None,26 host: {27 '[class]': 'classes()',28 },29 exportAs: 'zTable',30})31export class ZardTableComponent {32 readonly zType = input<ZardTableTypeVariants>('default');33 readonly zSize = input<ZardTableSizeVariants>('default');34 readonly class = input<ClassValue>('');3536 protected readonly classes = computed(() =>37 mergeClasses(38 tableVariants({39 zType: this.zType(),40 zSize: this.zSize(),41 }),42 this.class(),43 ),44 );45}4647@Component({48 selector: 'thead[z-table-header]',49 template: `50 <ng-content />51 `,52 changeDetection: ChangeDetectionStrategy.OnPush,53 encapsulation: ViewEncapsulation.None,54 host: {55 '[class]': 'classes()',56 },57 exportAs: 'zTableHeader',58})59export class ZardTableHeaderComponent {60 readonly class = input<ClassValue>('');6162 protected readonly classes = computed(() => mergeClasses(tableHeaderVariants(), this.class()));63}6465@Component({66 selector: 'tbody[z-table-body]',67 template: `68 <ng-content />69 `,70 changeDetection: ChangeDetectionStrategy.OnPush,71 encapsulation: ViewEncapsulation.None,72 host: {73 '[class]': 'classes()',74 },75 exportAs: 'zTableBody',76})77export class ZardTableBodyComponent {78 readonly class = input<ClassValue>('');7980 protected readonly classes = computed(() => mergeClasses(tableBodyVariants(), this.class()));81}8283@Component({84 selector: 'tr[z-table-row]',85 template: `86 <ng-content />87 `,88 changeDetection: ChangeDetectionStrategy.OnPush,89 encapsulation: ViewEncapsulation.None,90 host: {91 '[class]': 'classes()',92 },93 exportAs: 'zTableRow',94})95export class ZardTableRowComponent {96 readonly class = input<ClassValue>('');9798 protected readonly classes = computed(() => mergeClasses(tableRowVariants(), this.class()));99}100101@Component({102 selector: 'th[z-table-head]',103 template: `104 <ng-content />105 `,106// … truncated
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 |
