Skip to content
Site volume
Colourway

Components

Honeypot

The spam guard: an off-screen field people never reach, a timestamp, and the server check.

  • Beta
  • Reading layer
  • Server component
  • Since 0.1.0
  • Press check
Import from@maxgrits/overprint-react/honeypot
On this page

Example#

Look of this example
Live render of examples/honeypot/basic.tsx

Usage#

Use a honeypot and a timestamp on public forms to turn away most spam bots without a CAPTCHA. The honeypot is a field people never see; the timestamp records when the form appeared. checkSpam on the server rejects a filled honeypot or a send faster than 2.5 seconds.

  • Honeypot sits off-screen (not display: none, which bots skip), holds a labelled field "Leave this field empty", is out of the tab order and has autocomplete off.
  • FormTimestamp fills a hidden input with the time on mount, on the client, so static pages do not stamp the build time.
  • checkSpam(formData) returns { spam, reason }; a missing timestamp is not spam.

Anatomy#

  1. Honeypot: an off-screen div.mk-honeypot with a labelled text input, hidden from assistive tech and out of the tab order.
  2. Timestamp: a hidden input named _t, filled when the form mounts.

Neither prints anything, so there is nothing to draw.

Volume#

Neither prints anything, so both are the same at every volume.

Content#

  • The honeypot's label, "Leave this field empty", is the only copy, and only a bot ever reads it.

Do and don't#

Do

<Form action="/api/quote">
  …fields…
  <Honeypot />
  <FormTimestamp />
</Form>

Invisible checks.

Don't

A CAPTCHA on a three-field quote form.

A puzzle for every visitor.

CAPTCHAs cost every person time and lock some out entirely. The honeypot and the timer stop most bots and cost people nothing.

Accessibility#

  • The field is off-screen, aria-hidden and out of the tab order; people never meet it.
  • On the server, checkSpam(formData) flags a filled honeypot or a submit faster than 2.5 s.
KeysWhat happens
TabNever stops here: the field is out of the tab order and hidden from assistive tech

The colour pairs it prints, with their contrast on both papers:

It prints no text of its own (art layer or layout only), so it has no pair to check.

Props#

PropTypeDefaultDescription
namestringcompany_websiteThe field's name (default `company_website`, `checkSpam`'s default).
labelstringnoneThe label bots read (literal copy).
idPrefixstringmk-hpThe input's id prefix (default `mk-hp`): two forms on one page pass one each, as QuoteForm does (D-N101).

Generated from HoneypotProps in packages/overprint-react/src/reading/honeypot/honeypot.tsx.

Tokens#

It reads no --mk-* token of its own: it lays out the components inside it.

Changelog#

Arrived in 0.1.0.

0.1.024 October 2026

  • MinorreactThe reading layer's controls, overlays, forms and visitor prefs (P2-T1 to P2-T5): every Button is the comic hit key, with IconButton, Link and Tooltip; Input, Textarea, Select, Checkbox and CheckboxGroup, Radio and RadioGroup, Switch, Slider with the ruler, RulerReadout and SegmentedControl; Dialog, Drawer, NavSheet, Tabs, Disclosure, Faq and faqJsonLd on Base UI 1.9 where the platform falls short; Field, Fieldset, Form with the site's inline validation, ErrorSummary, Callout, Honeypot, FormTimestamp and QuoteForm; PrefsScript under 1 KB, usePref and setPref with cross-tab sync, ThemeToggle and the visitor VolumeDial; VisuallyHidden.