logo-icon
STW UI

Radio

Radio buttons allow the user to select one option from a set.

Usage

svelte
import { RadioGroup } from 'stwui';
// OR
import RadioGroup from 'stwui/radio'; // for tree shaking

Basic

  • Group Label Inline with Description

  • with Error

  • Here is an error!

    Pill

  • Pill with label and grid

    Radio Group 4
  • RadioGroup Props

    name string nanoid()
    type 'default' | 'pill' default
    selected string | undefined
    error string | undefined

    RadioGroup Slots

    label <RadioGroup.Label slot="label" />
    default <RadioGroup.Radio />

    RadioGroup.Label Slots

    default

    RadioGroup.Radio Props

    id string | undefined
    value string
    disabled boolean false

    RadioGroup.Radio Slots

    label <RadioGroup.Radio.Label slot="label" />
    description <RadioGroup.Radio.Description slot="description" />

    RadioGroup.Radio.Label Slots

    default

    RadioGroup.Radio.Description Slots

    default

    RadioGroup Class Identifiers

    stwui-radio-group
    stwui-radio-error
    stwui-radio-group-label
    stwui-radio
    stwui-radio-pill
    stwui-radio-label
    stwui-radio-description