Skip to content
Forms

RadioGroup

A set of radios that share a name and a bound value.

import
import { RadioGroup, Radio } from '@joshicodes/cock';

Group

Radio reads the name and the bound value from the group through context.

Behaviour

  • `Radio` reads the group through context, so it has to sit inside a `RadioGroup`. On its own it throws with a readable message rather than silently doing nothing.

API

Read out of the component sources at build time, so it matches the version you installed. Every component also takes class, merged through tailwind-merge so your utility wins.

<RadioGroup>

Props

PropTypeDefault
value bindable
string''
name
stringuid('radio')
disabled
booleanfalse
orientation
'vertical' | 'horizontal''vertical'
label
string—
class
string—

Snippets

SnippetTypeDefault
children
Snippet—

<Radio>

Props

PropTypeDefault
value required
string—
description
string—
disabled
booleanfalse
class
string—

Snippets

SnippetTypeDefault
children
Snippet—

See also

cock. Yes, it stands for core component kit. We checked twice.