Skip to content
ts
import Input from '~/ui/Input.vue'

Input

Let the user input a single-line text, password or number


Explicit size

Explicit shape

Some space
Some space

Using this component

A11y Checklist

Accessible input

ts
const username = ref('')
const password = ref('')
const search = ref('')
template
<Input
  v-model="username"
  required
  label="User name"
  autocomplete="username"
  :reset
>
  <template #start>
    <!-- user -->
    <Icon icon="material-symbols:person" />
  </template>
  <template #end>
    <!-- user -->
    <Button
      class="color-destructive-solid shape-square"
    />
    <Button
      class="color-primary-solid shape-square"
    />
  </template>
</Input>

<Input
  v-model="password"
  password
  label="Password"
/>

<Input
  v-model="search"
  search
/>

Also see the Form example

Test this component in isolation against WCAG2 criteria