> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pharen.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Form

> Importiere und verwende die Form-Komponenten aus @pharen/ui.

export const PharenUiPreview = ({name, title = 'Pharen UI component preview'}) => <div className="not-prose my-6 overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm dark:border-white/10 dark:bg-zinc-950">
    <div className="pharen-ui-preview-root" data-pharen-ui-preview data-example={name} role="region" aria-label={title} />
  </div>;

Mit **Form** kannst du einen Wert zu erfassen oder zu bearbeiten. Diese Seite dokumentiert alle Vue-Komponenten, die das Modul öffentlich exportiert.

<PharenUiPreview name="form" title="Form Vorschau" />

<Accordion title="Code anzeigen">
  ```vue theme={null}
  <script setup lang="ts">
  import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input } from '@pharen/ui';
  </script>

  <template>
    <Form class="w-full max-w-sm">
      <FormField v-slot="{ componentField }" name="email">
        <FormItem>
          <FormLabel>Email address</FormLabel>
          <FormControl><Input type="email" placeholder="you@company.com" v-bind="componentField" /></FormControl>
          <FormDescription>We use this address for account notifications.</FormDescription>
          <FormMessage />
        </FormItem>
      </FormField>
    </Form>
  </template>
  ```
</Accordion>

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @pharen/ui
  ```

  ```bash pnpm theme={null}
  pnpm add @pharen/ui
  ```

  ```bash yarn theme={null}
  yarn add @pharen/ui
  ```

  ```bash bun theme={null}
  bun add @pharen/ui
  ```
</CodeGroup>

<Note>
  Importiere `@pharen/ui/styles.css` genau einmal im Einstiegspunkt deiner Anwendung.
</Note>

## Verwendung

```ts theme={null}
import { FormControl, FormDescription, FormItem, FormLabel, FormMessage, Form, FormField } from '@pharen/ui';
```

## Exporte

| Export            | Aufgabe                                   |
| ----------------- | ----------------------------------------- |
| `FormControl`     | Exportierte Vue-Komponente dieses Moduls. |
| `FormDescription` | Zeigt ergänzende Beschreibung.            |
| `FormItem`        | Stellt ein einzelnes Element dar.         |
| `FormLabel`       | Beschriftet einen Wert oder Bereich.      |
| `FormMessage`     | Exportierte Vue-Komponente dieses Moduls. |
| `Form`            | Exportierte Vue-Komponente dieses Moduls. |
| `FormField`       | Exportierte Vue-Komponente dieses Moduls. |

## Quellcode

[Quellcode auf GitHub öffnen](https://github.com/PharenIT/ELEV8-Labs/tree/main/src/packages/ui/src/components/form)
