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,
  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 DisabledLabelDemo() {
  return (
    <div
      style={{
        display: "flex",
        flexDirection: "column",
        gap: "var(--may-space-2)",
        maxWidth: 360,
        color: "var(--may-color-text)",
      }}
    >
      <Label htmlFor="carrier" disabled>
        Carrier Lock
      </Label>
      <Field id="carrier" placeholder="No SIM" disabled />
    </div>
  );
}

More by adit-firdaus

View all
  • Steps

    Steps

    44
  • Popover

    Popover

    4
  • Adaptive Sheet

    Adaptive Sheet

    1
  • Notice Bar

    Notice Bar

    1
  • Adaptive Card

    Adaptive Card

  • Box

    Box

  • Pagination

    Pagination

  • Kbd

    Kbd

More in Forms

View all
  • Premium Auth

    Premium Auth

    592
  • Login 1

    Login 1

    70
  • Contact Card

    Contact Card

    1.1K
  • Contact Form

    Contact Form

    28
  • Form

    Form

    6
  • HeroUI Field Error

    HeroUI Field Error

    13
  • Form

    Form

    4
  • Book A Demo 4

    Book A Demo 4

    69