Forms & inputs
Layout
PasswordInput
A password field with a reveal button and a requirements hint. Use it on sign-up and sign-in forms.
Validating a form? vael-form wires this up with a schemaInstall
import { PasswordInput } from 'vael-ui'Playground
undefined
popover
Placement, behaviour and animation
undefined
undefined
Usage
<script setup lang="ts">
import { ref } from 'vue'
import { PasswordInput } from 'vael-ui'
const value = ref('')
</script>
<template>
<PasswordInput placeholder="Type here…" v-model="value" />
</template>Motion New
PasswordInput: its appearance and states.
<PasswordInput
:motion="{ states: { invalid: { root: { scale: 1.04 } } } }"
/>| Name | Type | Description |
|---|---|---|
initialexit | rootinputtogglehint | Sets where each part comes in from and leaves to: any CSS property, plus x, y and blur. A plain number is px, or degrees for rotate. |
states | invaliddisabledfocus | Sets values per part that hold while a state is on. An array is a set of keyframes that plays once as the state turns on, such as a shake on invalid. |
enterleave | (parts, context) => animation | Animates the parts with GSAP, motion or element.animate(). Return the animation and the component waits for it, and stops it if interrupted. |
springdurationeasing | { damping, response } | number | string | Times all of it: a spring, or a duration in ms with an easing. Never both. |
false | boolean | Turns its motion off, for an animation of your own on its exposed elements. |
Accessibility
| Key | Action |
|---|---|
| Tab | Moves focus from the input to the show and hide button. |
| EnterSpace | Shows or hides the password when the button has focus. |
- The show and hide button is labeled “Show password” or “Hide password” to match the current state.
- The requirements list describes the input through
aria-describedby, and each requirement reads as met or not met. As you type, a polite live region announces only the requirements that changed. - In
hintPlacement="popover", the list opens when the input takes focus and closes when it loses focus. - It is built on
Input, soFieldlabels it the same way.