This component no longer exists. It was in @zard’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-14 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
radio-group
zard/radio-groupRemovedComponent
@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/radio-group.jsonSource
1import {2 booleanAttribute,3 ChangeDetectionStrategy,4 Component,5 computed,6 forwardRef,7 inject,8 input,9 model,10 signal,11 ViewEncapsulation,12} from '@angular/core';13import { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';1415import type { ClassValue } from 'clsx';1617import { ZardIdDirective } from '@/shared/core';18import { mergeClasses, noopFn } from '@/shared/utils/merge-classes';1920import { radioGroupVariants, radioVariants } from './radio-group.variants';2122type OnTouchedType = () => void;23type OnChangeType = (value: unknown) => void;2425@Component({26 selector: 'z-radio-group, [z-radio-group]',27 template: '<ng-content />',28 providers: [29 {30 provide: NG_VALUE_ACCESSOR,31 useExisting: forwardRef(() => ZardRadioGroupComponent),32 multi: true,33 },34 ],35 changeDetection: ChangeDetectionStrategy.OnPush,36 encapsulation: ViewEncapsulation.None,37 host: {38 role: 'radiogroup',39 'data-slot': 'radio-group',40 '[attr.aria-disabled]': 'isDisabled() ? "true" : null',41 '[class]': 'classes()',42 },43 exportAs: 'zRadioGroup',44})45export class ZardRadioGroupComponent implements ControlValueAccessor {46 readonly class = input<ClassValue>('');47 readonly value = model<unknown>(null);48 readonly zDisabled = input(false, { transform: booleanAttribute });49 readonly name = input<string>('');5051 protected readonly formDisabled = signal(false);52 protected readonly classes = computed(() => mergeClasses(radioGroupVariants(), this.class()));53 readonly isDisabled = computed(() => this.zDisabled() || this.formDisabled());5455 private onChange: OnChangeType = noopFn;56 private onTouched: OnTouchedType = noopFn;5758 select(value: unknown): void {59 if (this.isDisabled()) return;60 this.value.set(value);61 this.onChange(value);62 this.onTouched();63 }6465 isSelected(value: unknown): boolean {66 return this.value() === value;67 }6869 writeValue(val: unknown): void {70 this.value.set(val);71 }7273 registerOnChange(fn: OnChangeType): void {74 this.onChange = fn;75 }7677 registerOnTouched(fn: OnTouchedType): void {78 this.onTouched = fn;79 }8081 setDisabledState(isDisabled: boolean): void {82 this.formDisabled.set(isDisabled);83 }84}8586@Component({87 selector: 'z-radio, [z-radio]',88 imports: [ZardIdDirective],89 template: `90 <button91 [id]="zId() || z.id()"92 type="button"93 role="radio"94 [attr.data-state]="checked() ? 'checked' : 'unchecked'"95 [attr.data-checked]="checked() ? '' : null"96// … truncated
