List
Press notes
One field, one action, inside the same hairline.
Pairs one field with an embedded submit action. The button appears after validation.
Press notes
One field, one action, inside the same hairline.
Three ways in. They share one source, so the pixels match whichever you pick.
npm install @noorddev/vlak-react
// once, next to your app's root
import "@noorddev/vlak-react/css";
import { InlineForm } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/inline-form.
npx @noorddev/vlak-cli add inline-form
The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/inline-form.json
The same registry item, installed by shadcn's CLI.
<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />
No React. Link vlak.css and use the markup and classes below.
import { InlineForm } from "@noorddev/vlak-react";
<InlineForm
placeholder="Your e-mail"
buttonLabel="Subscribe"
inputProps={{ "aria-label": "E-mail", type: "email" }}
onSubmit={(email) => subscribe(email)}
/>One field, one action; the action sits inside the field.
| Prop | Type | Default | Description |
|---|---|---|---|
placeholder | string | "Your e-mail" | |
buttonLabel | ReactNode | "Subscribe" | |
successLabel | ReactNode | "You're on the list" | |
validate | (value: string) => boolean | (v) => /.+@.+\..+/.test(v) | The action only appears once this returns true. Defaults to a loose e-mail check. |
onSubmit | (value: string) => void | ||
inputProps | InputHTMLAttributes<HTMLInputElement> |
Also accepts Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit">.
| Keys | Does |
|---|---|
| Enter | Submits once the value validates |
| Tab | Reaches the button only after the value validates |
<div class="rs-inline-field"><input class="rs-inline-input" placeholder="Your e-mail" /><span class="rs-reveal rs-reveal-in"><button class="rs-btn-primary rs-inline-btn">Subscribe</button></span></div>