Navigated to /docs/ui/components/form-control-label

FormControlLabel

Clickable label composition for checkbox, radio, and switch 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 { FormControlLabel } from "@tavojs/ui/form-control-label";

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/form-control-label.

When to use

Use it when

Use FormControlLabel when the label and compact control should form one clickable choice row.

Choose something else when

Use Field for text-like inputs that need a label above the control plus hints, errors, success, or warning messages.

Examples

FormControlLabel example

TSX
tsximport { FormControlLabel } from "@tavojs/ui/form-control-label";
import { Checkbox } from "@tavojs/ui";

export function FormControlLabelExample1() {
  return (
    <>
      <FormControlLabel label="Subscribe" control={<Checkbox />} />
    </>
  );
}

Common props and defaults

PropTypeDefaultDescription
classNamestring

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

Configures label for this component.
controlChild

Configures control for this component.
sizeSize

Configures size for this component.

Complete TypeScript API

Import from @tavojs/ui/form-control-label. Published exports: FormControlLabel, FormControlLabelProps.

FormControlLabelProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by FormControlLabel.

classNamestring

No

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

sxSx

No

Inherited sx attribute accepted by FormControlLabel.

idstring

No

Inherited id attribute accepted by FormControlLabel.

rolestring

No

Inherited role attribute accepted by FormControlLabel.

styleRecord<string, unknown>

No

Inherited style attribute accepted by FormControlLabel.

titlestring

No

Inherited title attribute accepted by FormControlLabel.

tabIndexnumber

No

Inherited tabIndex attribute accepted by FormControlLabel.

hiddenboolean

No

Inherited hidden attribute accepted by FormControlLabel.

disabledboolean

No

Inherited disabled attribute accepted by FormControlLabel.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by FormControlLabel.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by FormControlLabel.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by FormControlLabel.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by FormControlLabel.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by FormControlLabel.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by FormControlLabel.

labelChild

No

Configures label for this component.

controlChild

No

Configures control for this component.

sizeSize

No

Configures size 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

Use Field for text-like inputs that need a label above the control plus hints, errors, success, or warning messages.

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/form-control-label
Explicit CSS import@tavojs/ui/css/form-control-label
PreviewInteractive preview available on this page