Headless primitivesheadless

Label

@xui/core/label

The text label for a bare form control. Wrapping the control in <label xuiLabel> associates the two natively — clicking the text focuses the control, and assistive technology reads them together. For a control that also needs helper text or an error slot, reach for xui-form-field instead.

Install

pnpm add @xui/core/label

Examples

This package has no Storybook story yet, so there is nothing to render here. The API below is still extracted from the source.

API

XLabel

directive[xLabel]

The headless half of a label: a stable id, plus the control's validity and disabled state republished as signals.

Inputs

NameTypeDefaultidstringThe label's DOM id, so a control can point aria-labelledby at it. Defaults to a generated unique id.`x-label-${nextId++}`

Methods

ngOnInit(): void

Source

libs/core/label

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.