Data input

Radio

Native radio buttons for choosing one option from a group, with a legend, help text and error state.

Class nameTypeDescription
radioplf:radioComponentA native radio button
choiceplf:choicePartA row of a control and its label
choice-labelplf:choice-labelPartThe label, the click target

Default

Give the group one name; a different name makes a separate group.

Delivery frequency

Arrow keys move the selection within this group.

Disabled

Say why a choice is unavailable in its label; the disabled state alone does not explain it.

Delivery channel

Invalid

Your application adds and removes aria-invalid on each radio and the message; start the message with “Error:” so the state does not rely on color alone.

Required delivery channel

Error: choose a delivery channel.

React

Radio from @pelatform/react renders this radio button, in a choice row with its label when it has children, and takes its description and error state from a FieldGroup or Field around it.

Prop Values Default
children The label, in a choice row with the radio button None: the radio button alone

The other props are the native radio button’s, checked, defaultChecked, onChange, className and ref included.

CSS variables

Override on a root or on a single choice row.

Variable Default
--plf-choice-size 1rem (16px)
--plf-choice-accent --plf-color-primary
--plf-control-height-md The label’s height on touch screens, at least 40px; 24px with a mouse
--plf-field-gap --plf-space-2, the gap between the legend, rows and messages

Built with Pelatform UIv0.1.0

Components

Getting started

Foundations

Components

Actions

Data display

Navigation

Feedback

Data input

Layout

Advanced

Integrations

Blocks

Application

Authentication

Icons