Skip to content
العربية
Forms

Honeypot

An invisible field that only bots fill. Reject the form on the server when it has a value.

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

Examples

Code
export function HoneypotExample() {
  const t = useT();
  return (
    <form className="relative grid w-full max-w-xs gap-4" onSubmit={(e) => e.preventDefault()}>
      <Field label={t("Email", "البريد الإلكتروني")}>
        <Input type="email" name="email" dir="ltr" />
      </Field>
      {/* Invisible: reject the form on the server when "website" has a value. */}
      <Honeypot name="website" />
    </form>
  );
}