Skip to content

Input

Displays a form input field or a component that looks like an input field.

Examples

Default

vue
<script setup>
import { Input } from '@empathyds/vue'
</script>

<Input type="email" placeholder="Email" />

File

vue
<script setup>
import { Input, Label } from '@empathyds/vue'
</script>

<div class="grid w-full max-w-sm items-center gap-1.5">
  <Label for="picture">Picture</Label>
  <Input id="picture" type="file" />
</div>

Disabled

vue
<script setup>
import { Input } from '@empathyds/vue'
</script>

<Input disabled type="email" placeholder="Email" />

With Label

vue
<script setup>
import { Input, Label } from '@empathyds/vue'
</script>

<div class="grid w-full max-w-sm items-center gap-1.5">
  <Label for="email">Email</Label>
  <Input type="email" id="email" placeholder="Email" />
</div>

Props

Input

PropTypeDefaultDescription
modelValuestring | number-The controlled value of the input.
defaultValuestring | number-The default value of the input.
disabledbooleanfalseWhether the input is disabled.
typestring"text"The type of the input.
classstring-Custom classes to apply to the input.

Events

Input

EventPayloadDescription
update:modelValuestring | numberEvent handler called when the value changes.