Hone UI
Components

FormControlLabel and FormGroup

Pair a control with visible text, and stack related controls.

FormControlLabel wraps a Checkbox, a Radio or a Switch with a text label, so the text names the input and a click on it changes the control. FormGroup stacks several of them. FormControlLabel is a client component. FormGroup is a Server Component.

import FormControlLabel from '@hone-ui/react/FormControlLabel';
import FormGroup from '@hone-ui/react/FormGroup';

Examples

<FormControlLabel control={<Checkbox />} label="Remember me" />
<FormControlLabel control={<Switch />} label="Wi-Fi" labelPlacement="start" />

<FormGroup row>
  <FormControlLabel control={<Checkbox defaultChecked />} label="Email" />
  <FormControlLabel control={<Checkbox />} label="Phone" />
</FormGroup>

FormControlLabel props

PropTypeDefaultDescription
controlReactElementrequiredA Checkbox, Radio or Switch.
labelReactNoderequiredThe text. Wrapped in Typography unless disableTypography.
labelPlacement'end', 'start', 'top', 'bottom''end'Where the text sits.
disabledbooleanfrom the control, then the FormControlDisables the control and dims the text.
requiredbooleanfalseMarks the control required and adds a hidden asterisk.
checked, value, name, onChange, inputRefPassed to the control unless it sets its own.
disableTypographybooleanfalseRenders the label as given.
slotProps{ typography }noneProps for the label text.
sx, className, style, refStandard. They go to the root span.

FormGroup props

PropTypeDefaultDescription
rowbooleanfalseLays the controls out in a row.
sx, className, style, ref, childrenStandard.

Notes

  • control must be one of this library's controls. A plain button does not work.
  • required stays a prop of the label or the control. Put a form-wide asterisk on a FormLabel.
  • FormGroup ignores theme defaultProps, because it is a Server Component.

Accessibility

The root is a span, not a label. The text sits in its own label that points at the input, so labels never nest. Do not also give the control an aria-label, because the input would get two names. FormGroup is a plain div. Add role="group" and aria-label when the controls need a shared name.

On this page