Skip to content
العربية
Forms

Field

Label, control, hint, error and counter. The control inside gets its id, aria-describedby and aria-invalid automatically.

import { Field } from "@percentsa/ui";

Examples

As on your ID

Enter a valid email address.

Optional
Code
export function FieldExample() {
  const t = useT();
  return (
    <Stack gap={8} className="w-full max-w-md">
      <Field label={t("Name", "الاسم")} required hint={t("As on your ID", "كما في الهوية")}>
        <Input autoComplete="name" />
      </Field>
      <Field label={t("Email", "البريد الإلكتروني")} error={t("Enter a valid email address.", "أدخل بريدًا إلكترونيًا صحيحًا.")}>
        <Input type="email" dir="ltr" defaultValue="name@" />
      </Field>
      <Field label={t("Company", "الشركة")} optional>
        <Input />
      </Field>
    </Stack>
  );
}