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
| Prop | Type | Default |
|---|---|---|
value bindable | string | '' |
name | string | uid('radio') |
disabled | boolean | false |
orientation | 'vertical' | 'horizontal' | 'vertical' |
label | string | — |
class | string | — |
Snippets
| Snippet | Type | Default |
|---|---|---|
children | Snippet | — |
<Radio>
Props
| Prop | Type | Default |
|---|---|---|
value required | string | — |
description | string | — |
disabled | boolean | false |
class | string | — |
Snippets
| Snippet | Type | Default |
|---|---|---|
children | Snippet | — |