Navigated to /docs/ui/components/radio-group

RadioGroup

Radio fieldset that propagates names to child radio controls.

Preview

A live, theme-aware example rendered with the published component.

Loading preview…

Import

Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.

TSX
tsximport { RadioGroup } from "@tavojs/ui/radio-group";

Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/radio-group.

When to use

Use it when

Use `RadioGroup` to group radio options

Choose something else when

Avoid RadioGroup when wrapping controls without labels or accessible names.

Examples

RadioGroup example

TSX
tsximport { RadioGroup } from "@tavojs/ui/radio-group";
import { Radio } from "@tavojs/ui";

export function RadioGroupExample1() {
  return (
    <>
      <RadioGroup name="plan">
        <Radio value="starter" />
        <Radio value="scale" />
      </RadioGroup>
    </>
  );
}

Common props and defaults

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
namestring

Required

Configures name for this component.
orientation"horizontal" | "vertical"

Configures orientation for this component.

Complete TypeScript API

Import from @tavojs/ui/radio-group. Published exports: RadioGroup, RadioGroupProps.

RadioGroupProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by RadioGroup.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by RadioGroup.

idstring

No

Inherited id attribute accepted by RadioGroup.

rolestring

No

Inherited role attribute accepted by RadioGroup.

styleRecord<string, unknown>

No

Inherited style attribute accepted by RadioGroup.

titlestring

No

Inherited title attribute accepted by RadioGroup.

tabIndexnumber

No

Inherited tabIndex attribute accepted by RadioGroup.

hiddenboolean

No

Inherited hidden attribute accepted by RadioGroup.

disabledboolean

No

Inherited disabled attribute accepted by RadioGroup.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by RadioGroup.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by RadioGroup.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by RadioGroup.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by RadioGroup.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by RadioGroup.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by RadioGroup.

namestring

Yes

Configures name for this component.

orientation"horizontal" | "vertical"

No

Configures orientation for this component.

State ownership and DOM target

ConcernContract
StateNo component state contract is exposed; the application owns the rendered content and surrounding behavior.
DOM targetNative input attributes target the owned form control; wrapper-specific props stay on the documented component root.

Anatomy and related components

This component exposes one public component root rather than a compound member API.

Limitations

Avoid RadioGroup when wrapping controls without labels or accessible names.

Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.

Accessibility

Uses `fieldset` semantics and propagates `name` to child radios when possible.

  • Uses `fieldset` semantics and propagates `name` to child radios when possible.

Component status

ContractCurrent value
Maturitystable
Categoryforms
Component import@tavojs/ui/radio-group
Explicit CSS import@tavojs/ui/css/radio-group
PreviewInteractive preview available on this page