Forms & inputs
Layout
Textarea
A multi-line text field that can grow with its content. Use it for comments, notes and other long text.
Validating a form? vael-form wires this up with a schemaInstall
import { Textarea } from 'vael-ui'Playground
undefined
Usage
<script setup lang="ts">
import { ref } from 'vue'
import { Textarea } from 'vael-ui'
const value = ref('')
</script>
<template>
<Textarea placeholder="Type here…" v-model="value" />
</template>Motion New
Textarea: its appearance and states.
<Textarea
:motion="{ states: { invalid: { root: { scale: 1.04 } } } }"
/>| Name | Type | Description |
|---|---|---|
initialexit | roottextarea | 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
It has no keyboard interaction of its own.
- Renders a native
<textarea>and adds no keys of its own. - Inside a
Field, the label names it.aria-describedbylists your own ids first, then the Field’s description and error. - Outside a
Field, give it anaria-label, which goes to the textarea. It setsaria-invalidwhen invalid andaria-requiredwhen theFieldis required. - The
#displayslot isaria-hidden; screen readers read the textarea underneath.