Quick Start
Try a project form, copy its code, and adapt it to your app.
Build a project form with a name, region, notes, and a submit button. This example shows a confirmation message in the browser; it does not save to a server.
First, complete Installation. You should already be able to render a styled Zenos button.
One working form takes you through the basics.
- Try the previewIn this guide
Enter a name → submit → see confirmation
Test the form below before changing anything.
- Copy the codeIn your editor
Code tab → ProjectForm.tsx → your page
Use the same source that powers the preview.
- Connect your appYour next step
Your fields + validation + save action
The demo confirms locally. Your app decides how to save real data.
1. Try the form
Section titled “1. Try the form”Enter a project name, choose a region, and select Create project. You should see “Project created locally.” without a page reload.
The name is required. Try submitting with it empty, then use Tab and the arrow keys to move through the form and select a region.
2. Add it to your app
Section titled “2. Add it to your app”Open Code in the preview and copy the example into a component file, such as src/ProjectForm.tsx. The displayed code comes from the same source as the working preview.
Add this line at the end of the copied file so another file can import it:
export default FormExample;Then render it from your page. For a Vite app, your src/App.tsx could be:
import ProjectForm from "./ProjectForm"; export default function App() { return <ProjectForm />;}In Next.js, add "use client" at the top of the form file because it uses React state. In Astro, render the form with client:load. The framework setup examples show where styles and client boundaries belong.
3. Make it yours
Section titled “3. Make it yours”Start with the labels, placeholders, and region choices. Then replace the example’s setCreated(true) with your app’s save operation, including loading and error states.
The form is built from a few pieces:
- FormLayout arranges the fields in one column, then two from the
mdbreakpoint. - Field connects a label, input, description, and any error message.
- Input, Select, and Textarea let people enter and choose values.
- Button submits the form. Text announces the local confirmation.
How does a label connect to an input?
Keep the control inside its Field.Root. Field.Control passes the field’s ID, required state, and accessible relationships to the Input through render:
<Field.Root required> <Field.Label>Project name</Field.Label> <Field.Control render={<Input name="projectName" />} /> <Field.Description>Use a name your team will recognize.</Field.Description></Field.Root>Add your application’s validation rules when connecting a real save operation. Use invalid and Field.Error to display an error that explains how to fix the value. See Field for the full API.
How do I change the columns or spacing?
Change the layout props on the form:
<FormLayout as="form" columns={{ base: 1, md: 2 }} gap="4"> {/* Fields and actions */}</FormLayout>base: 1 means one column on smaller screens. md: 2 means two columns from the medium breakpoint. gap="4" uses the spacing scale.
The preview also uses a few Tailwind classes for width, alignment, and the Notes field’s span. If your app does not use Tailwind, replace those classes with your own CSS. Zenos components and responsive layout props work with the package stylesheet alone.
See FormLayout and Layout composition for more layouts.
When should my app manage a field’s value?
The example’s Select uses defaultValue="singapore", so it manages the selected region itself. Use value with onValueChange when your app needs to read, reset, or coordinate that selection. See the controlled Select example.
Native inputs such as Input use their normal React props, including value and onChange. Keep your save logic and validation in your form or feature code.
Check your version
Section titled “Check your version”Before connecting real data:
- Submit a filled form and confirm it updates without reloading the page.
- Use only the keyboard to enter values, choose a region, and submit.
- Resize the page and check that fields remain readable and in the right order.
- Check both themes if your app supports dark mode.
- Run your app’s tests, type check, and production build.
Next, try Dialog for an edit flow, AppShell for a full page, or Working with AI to give your assistant the Zenos context.