Navigated to /docs/ui/components/radio

Radio

Token-styled radio input primitive.

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 { Radio } from "@tavojs/ui/radio";

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.

When to use

Use it when

Use `Radio` for individual radio controls

Choose something else when

Avoid Radio when wrapping controls without labels or accessible names.

Examples

Radio example

TSX
tsximport { Radio } from "@tavojs/ui/radio";

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

Common props and defaults

PropTypeDefaultDescription
classNamestring

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

Configures checked for this component.
defaultCheckedboolean

Configures defaultChecked for this component.
disabledboolean

Configures disabled for this component.
sizeSize

Configures size for this component.
tone"primary" | "secondary" | "neutral"

Configures tone for this component.

Complete TypeScript API

Import from @tavojs/ui/radio. Published exports: Radio, RadioProps.

RadioProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by Radio.

classNamestring

No

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

sxSx

No

Inherited sx attribute accepted by Radio.

idstring

No

Inherited id attribute accepted by Radio.

rolestring

No

Inherited role attribute accepted by Radio.

styleRecord<string, unknown>

No

Inherited style attribute accepted by Radio.

titlestring

No

Inherited title attribute accepted by Radio.

tabIndexnumber

No

Inherited tabIndex attribute accepted by Radio.

hiddenboolean

No

Inherited hidden attribute accepted by Radio.

disabledboolean

No

Configures disabled for this component.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by Radio.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by Radio.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by Radio.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by Radio.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by Radio.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by Radio.

checkedboolean

No

Configures checked for this component.

defaultCheckedboolean

No

Configures defaultChecked for this component.

sizeSize

No

Configures size for this component.

tone"neutral" | "primary" | "secondary"

No

Configures tone for this component.

State ownership and DOM target

ConcernContract
StateApplication controlled through checked and the matching callback.
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 Radio 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

Form components pass through native attributes and should be paired with visible labels or accessible names.

  • Use Field, FormLabel, FormControlLabel, or aria-label for labeling.

  • Preserve native input semantics whenever possible.

  • Expose validation with error text and aria-invalid where relevant.

Component status

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