Anex UI logoAnex UI
npm install anexui
Documentation

Documentation

Label

A styled <label> element with an optional required indicator.

Preview

Usage

import { Label } from "anexui";

<Label htmlFor="email">Email address</Label>
<Input id="email" type="email" />
Copy code

Required indicator

<Label htmlFor="name" required>Full name</Label>
<Input id="name" required />
Copy code

The * is rendered with aria-hidden="true" so screen readers don't announce it — the input's own required attribute handles that.

Disabled appearance

<Label htmlFor="locked" className="opacity-50">Locked field</Label>
<Input id="locked" disabled />
Copy code

Props

| Prop | Type | Default | Description | |---|---|---|---| | htmlFor | string | — | ID of the associated form control | | required | boolean | false | Shows a visible * indicator (aria-hidden) |

All standard HTML <label> attributes are accepted.

Accessibility