Skip to content

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 textarea

Imports ​

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 ​

PropTypeDefaultDescription
valuestring-Controlled textarea value.
defaultValuestring-Initial uncontrolled value.
placeholderstring-Placeholder text.
rowsnumber-Native rows attribute.
disabledboolean-Disables user interaction.
ariaLabelstring-Accessible label for unlabeled textareas.
ariaDescribedbystring-ID reference for additional accessible description.
ariaErrormessagestring-ID reference for accessible error message.

Events ​

EventReact propDetailDescription
value-changeonValueChangevalue: string, nativeEvent: EventEmitted when the textarea value changes.
focus-changeonFocusChangefocused: boolean, nativeEvent: FocusEventEmitted when focus state changes.

Slots ​

SlotDescription
messageValidation or help message.

Styling ​

Uses Tailwind: yes

Theme tokens:

  • border-input
  • ring-ring
  • text-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:

  • cn
  • globals

Files:

  • templates/react/textarea.tsx → components/ui/textarea.tsx
  • templates/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" />
}

Released under the MIT License.