adit-firdaus

Label

Forms

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 }: { id: string; placeholder: string }) {
  return (
    <input
      id={id}
      placeholder={placeholder}
      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%",
      }}
    />
  );
}

export default function LabelVariantsDemo() {
  return (
    <div
      style={{
        display: "flex",
        flexDirection: "column",
        gap: "var(--may-space-2)",
        maxWidth: 360,
        color: "var(--may-color-text)",
      }}
    >
      <Label variant="headline" htmlFor="a">
        Headline label
      </Label>
      <Label variant="body">Body label</Label>
      <Label variant="subheadline">Subheadline label (default)</Label>
      <Label variant="footnote" tone="secondary">
        Footnote label, secondary
      </Label>
      <Field id="a" placeholder="One field, five labels" />
    </div>
  );
}

More by adit-firdaus

View all
  • Steps

    Steps

    36
  • Popover

    Popover

    3
  • Adaptive Card

    Adaptive Card

  • Box

    Box

  • Pagination

    Pagination

  • Adaptive Sheet

    Adaptive Sheet

  • Notice Bar

    Notice Bar

  • Kbd

    Kbd

More in Forms

View all
  • Premium Auth

    Premium Auth

    577
  • Login 1

    Login 1

    68
  • Contact Card

    Contact Card

    1.1K
  • Form

    Form

    18
  • Login Card

    Login Card

    36
  • Login 2

    Login 2

    15
  • Change Password Form

    Change Password Form

    11
  • Form

    Form

    3