FormLabel
Low-level standalone label for manually composed form layouts.
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.
tsximport { FormLabel } from "@tavojs/ui/form-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-label.
When to use
Use it when
Choose something else when
Examples
FormLabel example
tsximport { FormLabel } from "@tavojs/ui/form-label";
export function FormLabelExample1() {
return (
<>
<FormLabel>Account settings</FormLabel>
</>
);
}Common props and defaults
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Optional class hook applied to the public root element owned by the component. |
size | Size | md | Control scale: sm, md, or lg when supported. Applies to FormLabel. |
disabled | boolean | false | Disables the control when supported. Applies to FormLabel. |
aria-* | unknown | — | ARIA attributes are passed through for accessible labeling and state. Applies to FormLabel. |
Complete TypeScript API
Import from @tavojs/ui/form-label. Published exports: FormLabel, FormLabelProps.
FormLabelProps
| Property | Type | Required | Description |
|---|---|---|---|
children | Child | No | Inherited children attribute accepted by FormLabel. |
className | string | No | Optional class hook applied to the public root element owned by the component. |
sx | Sx | No | Inherited sx attribute accepted by FormLabel. |
id | string | No | Inherited id attribute accepted by FormLabel. |
role | string | No | Inherited role attribute accepted by FormLabel. |
style | Record<string, unknown> | No | Inherited style attribute accepted by FormLabel. |
title | string | No | Inherited title attribute accepted by FormLabel. |
tabIndex | number | No | Inherited tabIndex attribute accepted by FormLabel. |
hidden | boolean | No | Inherited hidden attribute accepted by FormLabel. |
disabled | boolean | No | Disables the control when supported. Applies to FormLabel. |
onClick | TavoEventHandler<MouseEvent> | No | Inherited onClick attribute accepted by FormLabel. |
onChange | TavoEventHandler<Event> | No | Inherited onChange attribute accepted by FormLabel. |
onInput | TavoEventHandler<Event> | No | Inherited onInput attribute accepted by FormLabel. |
onKeyDown | TavoEventHandler<KeyboardEvent> | No | Inherited onKeyDown attribute accepted by FormLabel. |
onFocus | TavoEventHandler<FocusEvent> | No | Inherited onFocus attribute accepted by FormLabel. |
onBlur | TavoEventHandler<FocusEvent> | No | Inherited onBlur attribute accepted by FormLabel. |
State ownership and DOM target
| Concern | Contract |
|---|---|
| State | No component state contract is exposed; the application owns the rendered content and surrounding behavior. |
| DOM target | Native 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
Prefer Field for common inputs because Field generates label, message, required-state, and ARIA wiring together.
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
| Contract | Current value |
|---|---|
| Maturity | stable |
| Category | forms |
| Component import | @tavojs/ui/form-label |
| Explicit CSS import | @tavojs/ui/css/form-label |
| Preview | Interactive preview available on this page |