BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shuip/tsf-radio-field

tsf-radio-field

shuip/tsf-radio-field
FreeComponent

shuip publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by shuip on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://shuip.plvo.dev/r/tsf-radio-field.json

Source

./items/tanstack-form/radio-field/component.tsxshuip.plvo.dev/r/tsf-radio-field.json
1'use client';
2
3import { Field, FieldDescription, FieldError, FieldLabel } from '@/components/ui/field';
4import { Label } from '@/components/ui/label';
5import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
6import { useFieldContext } from '@/components/ui/shuip/tanstack-form/form-context';
7
8export interface RadioFieldOption {
9 label: string;
10 value: string;
11}
12
13export interface RadioFieldProps {
14 options: RadioFieldOption[];
15 label?: string;
16 description?: string;
17 fieldProps?: React.ComponentProps<typeof Field>;
18 props?: React.ComponentProps<typeof RadioGroup>;
19}
20
21export function RadioField({ options, label, description, fieldProps, props }: RadioFieldProps) {
22 const field = useFieldContext<string>();
23 const { isValid, errors } = field.state.meta;
24
25 return (
26 <Field className='gap-2' data-invalid={!isValid} {...fieldProps}>
27 {label && <FieldLabel>{label}</FieldLabel>}
28 <RadioGroup
29 name={field.name}
30 value={field.state.value}
31 onValueChange={(value) => field.handleChange(value)}
32 onBlur={field.handleBlur}
33 {...props}
34 >
35 {options.map((option) => (
36 <div key={option.value} className='flex items-center space-x-3 space-y-0'>
37 <RadioGroupItem id={`${field.name}-${option.value}`} value={option.value} aria-invalid={!isValid} />
38 <Label htmlFor={`${field.name}-${option.value}`}>{option.label}</Label>
39 </div>
40 ))}
41 </RadioGroup>
42 {!isValid && (
43 <FieldError
44 className='text-xs text-left'
45 errors={errors.map((error) => ({ message: typeof error === 'string' ? error : error?.message }))}
46 />
47 )}
48 {description && <FieldDescription className='text-xs'>{description}</FieldDescription>}
49 </Field>
50 );
51}

What it pulls in

Other registry items

  • field
  • label
  • radio-group
  • tsf-form-context

Files it writes

  • ./items/tanstack-form/radio-field/component.tsx

Facts

Registry
shuip
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
today

Go to the source

Docs on shuip shuip.plvo.dev Raw registry item This item as JSON

More from shuip

All 52 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
confirmation-dialogconfirmation-dialogshuipComponentsFree1 dep
copy-buttoncopy-buttonshuipComponentsFree3 deps
hover-revealhover-revealshuipComponentsFree1 dep
rhf-address-fieldrhf-address-fieldshuipComponentsFree5 deps · 2 files
rhf-autocomplete-fieldrhf-autocomplete-fieldshuipComponentsFree4 deps
rhf-checkbox-fieldrhf-checkbox-fieldshuipComponentsFree3 deps
rhf-combobox-fieldrhf-combobox-fieldshuipComponentsFree5 deps
rhf-date-fieldrhf-date-fieldshuipComponentsFree6 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex