# 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](/getting-started/installation/). You should already be able to render a styled Zenos button.

Try it, copy it, make it yours:

One working form takes you through the basics.

1. **Try the preview.** `Enter a name → submit → see confirmation`. Test the form below before changing anything.
2. **Copy the code.** `Code tab → ProjectForm.tsx → your page`. Use the same source that powers the preview.
3. **Connect your app.** `Your fields + validation + save action`. The demo confirms locally. Your app decides how to save real data.

## 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.

```tsx
import { Button, Field, FormLayout, Input, Select, Text, Textarea } from "@zentara-co/zenos-ui";
import { type SubmitEvent, useState } from "react";

function FormExample() {
  const [created, setCreated] = useState(false);

  return (
    <FormLayout
      as="form"
      columns={{ base: 1, md: 2 }}
      gap="4"
      className="w-full max-w-2xl"
      onSubmit={(event: SubmitEvent<HTMLFormElement>) => {
        event.preventDefault();
        setCreated(true);
      }}
    >
      <Field.Root required>
        <Field.Label>Project name</Field.Label>
        <Field.Control
          render={<Input name="projectName" placeholder="Security workspace" autoComplete="off" />}
        />
        <Field.Description>Use a name your team will recognize.</Field.Description>
      </Field.Root>
      <Field.Root>
        <Field.Label>Region</Field.Label>
        <Select.Root defaultValue="singapore">
          <Select.Trigger aria-label="Region">
            <Select.Value />
          </Select.Trigger>
          <Select.Content>
            <Select.Item value="singapore">Singapore</Select.Item>
            <Select.Item value="frankfurt">Frankfurt</Select.Item>
          </Select.Content>
        </Select.Root>
      </Field.Root>
      <Field.Root className="md:col-span-2">
        <Field.Label>Notes</Field.Label>
        <Field.Control render={<Textarea placeholder="Deployment context" />} />
      </Field.Root>
      <Button type="submit" variant="primary">
        Create project
      </Button>
      <Text aria-live="polite" color="success" className="self-center">
        {created ? "Project created locally." : ""}
      </Text>
    </FormLayout>
  );
}
```

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

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:

```tsx
export default FormExample;
```

Then render it from your page. For a Vite app, your `src/App.tsx` could be:

```tsx title="src/App.tsx"
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](/getting-started/installation/#2-load-the-styles) show where styles and client boundaries belong.

## 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 `md` breakpoint.
- **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.

<details>
<summary>How does a label connect to an input?</summary>

Keep the control inside its `Field.Root`. `Field.Control` passes the field's ID, required state, and accessible relationships to the `Input` through `render`:

```tsx
<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](/components/field/) for the full API.

</details>

<details>
<summary>How do I change the columns or spacing?</summary>

Change the layout props on the form:

```tsx
<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](/layout/form-layout/) and [Layout composition](/layout/composition/) for more layouts.

</details>

<details>
<summary>When should my app manage a field's value?</summary>

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](/components/select/).

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.

</details>

## Check your version

Before connecting real data:

1. Submit a filled form and confirm it updates without reloading the page.
2. Use only the keyboard to enter values, choose a region, and submit.
3. Resize the page and check that fields remain readable and in the right order.
4. Check both themes if your app supports dark mode.
5. Run your app's tests, type check, and production build.

Next, try [Dialog](/components/dialog/) for an edit flow, [AppShell](/layout/app-shell/) for a full page, or [Working with AI](/getting-started/working-with-ai/) to give your assistant the Zenos context.

Source: https://zenos-ui.pages.dev/getting-started/quick-start/