# UiInput

## Usage

```html
<template>
  <UiInput
    id="postal-code"
    name="postal_code"
    value="04277"
    required
    placeholder="12345"
  >
    Postal code
  </UiInput>
</template>

<script lang="ts" setup>
import UiInput from "@dpa-id-components/dpa-shared-components/components/UiInput/UiInput.vue";
</script>
```

**Using `v-model`**:

```html
<template>
  <UiInput v-model="postalCode">
    Postal code
  </UiInput>
</template>

<script lang="ts" setup>
import UiInput from "@dpa-id-components/dpa-shared-components/components/UiInput/UiInput.vue";
import { ref } from "vue";

const postalCode = ref();
</script>
```

**With `number` value**:

```html
<template>
  <UiInput v-model="count" type="number">
    Count
  </UiInput>
</template>

<script lang="ts" setup>
import UiInput from "@dpa-id-components/dpa-shared-components/components/UiInput/UiInput.vue";
import { ref } from "vue";

const count = ref();
</script>
```

This component binds all non-prop attributes (apart from `class`) on its principal element (either an `input` or `textarea` element) instead of the root element. This allows you to add arbitrary HTML attributes (and event listeners) on the principal element without them being explicitly supported by the component.
