Textarea
Styled textarea component built on the zw-textarea primitive.
@zeus-web/textareaData Entryzweb add textareaGenerated
Playground
Source
Choose the framework entry that matches your application.
html
<script type="module">
import '@zeus-web/textarea/wc/auto'
</script>
<zw-textarea placeholder="Describe the change"></zw-textarea>tsx
import { Textarea } from '@zeus-web/textarea/react'
export function TextareaExample() {
return <Textarea placeholder="Describe the change" />
}vue
<script setup lang="ts">
import { Textarea } from '@zeus-web/textarea/vue'
</script>
<template>
<Textarea placeholder="Describe the change" />
</template>Add
bash
zweb add textareaImports
Styled registry component:
tsx
import { Textarea } from '@/components/ui/textarea'Primitive React wrapper:
tsx
import { Textarea } from '@zeus-web/textarea/react'Web Component entry:
ts
import '@zeus-web/textarea/wc/auto'Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | - | Controlled textarea value. |
defaultValue | string | - | Initial uncontrolled value. |
placeholder | string | - | Placeholder text. |
rows | number | - | Native rows attribute. |
disabled | boolean | - | Disables user interaction. |
ariaLabel | string | - | Accessible label for unlabeled textareas. |
ariaDescribedby | string | - | ID reference for additional accessible description. |
ariaErrormessage | string | - | ID reference for accessible error message. |
Events
| Event | React prop | Detail | Description |
|---|---|---|---|
value-change | onValueChange | value: string, nativeEvent: Event | Emitted when the textarea value changes. |
focus-change | onFocusChange | focused: boolean, nativeEvent: FocusEvent | Emitted when focus state changes. |
Slots
| Slot | Description |
|---|---|
message | Validation or help message. |
Styling
Uses Tailwind: yes
Theme tokens:
border-inputring-ringtext-muted-foreground
Internal selectors:
[data-slot=textarea][data-slot=textarea-message]
Registry
Registry source: available.
Add command: zweb add textarea
Type: component
Dependencies:
@zeus-web/textarea
Registry dependencies:
cnglobals
Files:
templates/react/textarea.tsx→components/ui/textarea.tsxtemplates/vue/textarea.ts→components/ui/textarea.ts
AI usage rules
Do:
- Use Textarea for multi-line text input.
Do not:
- Do not use Input for multi-line content.
Examples
React styled usage
tsx
import { Textarea } from '@/components/ui/textarea'
export function Example() {
return <Textarea placeholder="Message" />
}