Dojo NG is being built in the open, one section at a time — follow along on Heptapod.

API REFERENCE · FORM CONTROLS

<dj-label>

A form label. Content goes in the default slot.

Note: native for/id association does not cross shadow boundaries, so associate by wrapping the control in the label's light DOM, or rely on the consuming field component to wire ARIA. for-id is still reflected for same-root cases.

Deviates from the Dojo widget in one name: the visually-hidden flag is visually-hidden (not hidden) to avoid clobbering the native hidden attribute.

Try it in the playground

@dojo-ng/label · v0.1.1

npm install @dojo-ng/label

import "@dojo-ng/label";

Properties

PropertyAttributeTypeDefault
disabled disabled reflected boolean false
focused focused reflected boolean false
required required reflected boolean false
readonly readonly reflected boolean false
secondary secondary reflected boolean false
active active reflected boolean false
visuallyHiddenVisually hide the label while keeping it accessible. visually-hidden reflected boolean false
validTri-state validity: true (valid), false (invalid), undefined (unset). valid boolean None
forIdId of the control to associate (effective only within the same root). for-id string None

Slots

Default slot

CSS parts

Style these with dj-label::part(name).

base