waitlist-email-react
v0.3.0
Published
A dead-simple waitlist email collection form/client for self-hosted waitlist-email instances.
Maintainers
Readme
waitlist-email-react
The official React component and client library for self-hosted waitlist-email backends.
Add a simple, reliable email waitlist to your Next.js or React site in seconds.
Quick Start
1. Install
npm i waitlist-email-react2. Add to your page
import { WaitlistForm } from "waitlist-email-react/react";
export default function App() {
return (
<WaitlistForm
baseUrl="https://your-backend.vercel.app"
projectId="my-project"
/>
);
}That's it! It automatically handles submitting, loading states, validation, and feedback messages.
Customization & Styling (Zero CSS / Tailwind Required)
WaitlistForm comes with responsive built-in inline styles so you don't need to write Tailwind CSS or external CSS files. The input field and button sit cleanly in the same row, with the input automatically expanding to take up more width than the button.
<WaitlistForm
baseUrl="https://your-backend.vercel.app"
projectId="my-project"
maxWidth="500px"
borderRadius="8px"
buttonColor="#2563eb"
buttonTextColor="#ffffff"
/>When the user clicks (focuses) the email input, the outline color automatically matches buttonColor (e.g. #2563eb).
Props
| Prop | Default | Description |
| ------------------ | ------------------- | ------------------------------------------------------------------------------------ |
| baseUrl (req) | — | Your self-hosted waitlist backend URL |
| projectId (req)| — | Your project ID created on the backend |
| placeholder | "[email protected]" | Input placeholder text |
| buttonLabel | "Join waitlist" | Button label |
| loadingLabel | "Joining..." | Button label while submitting |
| successMessage | — | Custom text shown on successful email submission |
| width | "100%" | Form width (e.g., "100%", "400px", 400) |
| maxWidth | "100%" | Form max width (e.g., "500px", 500) |
| borderRadius | "8px" | Border radius for both input box and button (e.g., "8px", 8, "0.5rem") |
| buttonColor | "#000000" | Button background color. Automatically becomes input focus outline color when clicked |
| buttonTextColor | "#ffffff" | Button text color |
| showModal | true | Displays a responsive modal popup for status feedback (success, error, already registered) |
| onSuccess | — | Callback: (status: "success" \| "already_exists") => void |
| onError | — | Callback: (message: string) => void |
| style | — | Extra inline styles for <form> |
| className | "" | Extra class name for <form> |
Headless API (Vanilla JS / TypeScript)
If you want to build your own custom form, use joinWaitlist directly:
import { joinWaitlist } from "waitlist-email-react";
const res = await joinWaitlist({
baseUrl: "https://your-backend.vercel.app",
projectId: "my-project",
email: "[email protected]",
});
if (res.ok) {
console.log(res.message); // "You're on the list!"
} else {
console.error(res.message); // "Something went wrong."
}