Label Text
Short text that names a field, value, or group.
- Status
- ReadyBuild day 2 of 21
- Code
- In React
- Role
- Display
Usage
This demo is live, and the code below it is the same code, imports included. The component lives in src/ui of this repository and is not published to npm yet.
Pastes as editable layers. Shadows are not exported.
import { LabelText } from "@/ui";
export default function LabelTextDemo() {
return (
<div>
<LabelText htmlFor="full-name" indicator="required">Full name</LabelText>
<input id="full-name" required />
</div>
);
}Variants and states
Every specimen is the real component from src/ui, held in one state.
Pastes as editable layers. Shadows are not exported.
Props
- size
- "sm" | "md" | "lg" · default "md"
- 12px, 14px, or 16px text.
- indicator
- "none" | "required" | "optional" · default "none"
- Adds an asterisk or (optional). One prop, because showing both is a content bug.
- error
- boolean · default false
- Danger color.
- disabled
- boolean · default false
- Muted color. Set the native disabled attribute on the field too.
- icon
- ReactNode · default none
- Decorative icon after the label, such as an info icon.
- ...rest
- LabelHTMLAttributes · default none
- Every other native label attribute, such as htmlFor.
Figma to code
Figma properties by their exact names from Naming, and the React prop that carries each one. The table covers the shared properties that bear on this component; the Figma file decides which of them its component exposes. None means there is no prop for it yet.
- 💡 Indicator
- indicator
- none, required, or optional.
- 📐 Size
- size
- sm, md, or lg.
- 🎯 State
- error, disabled
- Error and Disabled are boolean props.
- 🖍 Label
- children
- The label text.
- Show Icon Right, Change Icon Right
- icon
- Pass an icon element to show it.
Accessibility
What the code in src/ui does today, and what it leaves to you.
Keyboard
- Not focusable. Clicking it moves focus to the field named by htmlFor.
Screen readers
- A native label: with htmlFor it is the field's accessible name.
- The required asterisk is aria-hidden. The icon is aria-hidden too. (optional) is read as text.
What you still need to do
- Pass htmlFor, or wrap the field, so the label names it.
- Set the native required attribute on the field. The asterisk alone tells a screen reader nothing.
- Put what an info icon explains in a hint, because the icon is decorative.
When to use
Sits above inputs and beside values in summaries, set in Caption 1 semibold.
Do and don't
Do
- Write labels as nouns: "Account number", not "Enter your account number".
- Connect every form label to its input.
Don't
- Replace a label with placeholder text.
- End labels with a colon when they sit above the field.
Related
4 of 16 other atoms, same role and ready ones first.
- AvatarA visual representation of a user, team, or entity.Ready
- BadgeA small label used to highlight status, category, or count.Ready
- ChipA compact label for a category, filter, or selected value.Ready
- CommentA single message in a discussion, with author, time, and text.Ready
Status reflects the component tracker snapshot of 29 October 2026.