About
An accessible form label that pairs with a control via htmlFor, with built-in required/disabled states, Apple-style typography variants, and an uppercase "eyebrow" style for settings-style section headers.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Label to your project and fits it to your theme.
Code
How Label is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import Label from "@/components/ui/label";
function Field({
id,
placeholder,
disabled,
}: {
id: string;
placeholder: string;
disabled?: boolean;
}) {
return (
<input
id={id}
placeholder={placeholder}
disabled={disabled}
style={{
height: "var(--may-control-h)",
padding: "0 var(--may-space-4)",
borderRadius: "var(--may-radius-md)",
background: "var(--may-color-fill-tertiary)",
color: "var(--may-color-text)",
font: "inherit",
border: 0,
outline: "none",
width: "100%",
opacity: disabled ? 0.35 : 1,
}}
/>
);
}
export default function RequiredLabelDemo() {
return (
<div
style={{
display: "flex",
flexDirection: "column",
gap: "var(--may-space-2)",
maxWidth: 360,
color: "var(--may-color-text)",
}}
>
<Label htmlFor="apple-id" required>
Apple ID
</Label>
<Field id="apple-id" placeholder="[email protected]" />
<p
className="may-text"
data-slot="text"
data-variant="caption-1"
data-tone="tertiary"
style={{ margin: 0 }}
>
Used for iCloud, iMessage and the App Store.
</p>
</div>
);
}
















![Form [react-aria-components]](https://cdn.21st.dev/cdn-cgi/image/fit=scale-down,width=640,quality=75,format=webp/https://cdn.21st.dev/user_jolbol1/field/814/preview.png)