Dot Signup
A pill of a field outlined in dots with the button set inside it. Its colour dissolves in once the address is well formed; it marches while your onSubmit runs, then shows a check. A likely slip in the domain (gmial.com, hotmial.com, acme.con) gets a one-tap fix, and an error shakes the field and says why. It's a real form underneath, so autofill, Enter and screen readers all work.
Needs: None. Canvas 2D.
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| onSubmit | (email: string) => Promise<unknown> | void | required | Sends the address. Throw or reject with a message to show it. |
| label | string | "Subscribe" | The button's word. |
| doneLabel | string | "Done" | The button's word once it's done. |
| placeholder | string | "you@example.com" | The field's placeholder. |
| note | string | – | A line under the field before anything's sent. |
| success | string | "You're in. Check your inbox to confirm." | The line under the field once it's done. |
| timeout | number | 20000 | Give up waiting for onSubmit after this many ms and say so. 0 waits forever. |
| tone | string | – | The button's colour. The page's accent by default. |
| pitch | number | 2 | Size of one dot in px. |
| name | string | "email" | The input's name, for forms that read it. |
| className | string | – | Class on the form. |
| style | CSSProperties | – | Style on the form. |