shadcn-templ 2.0 beta. Switch to templUI v1
1.7k

Textarea

Displays a form textarea or a component that looks like a textarea.

package examples import "github.com/axadrn/shadcn-templ/v2/components/textarea"

Installation

shadcn-templ add textarea

Usage

import "github.com/axadrn/shadcn-templ/v2/components/textarea"
@textarea.Textarea()

Field

Use Field, FieldLabel, and FieldDescription to create a textarea with a label and description.

Enter your message below.

package examples import (

Disabled

Use the Disabled prop to disable the textarea. To style the disabled state, set Disabled on the field.Field component.

package examples import (

Invalid

Use aria-invalid to mark the textarea as invalid. To style the invalid state, set Invalid on the field.Field component.

Please enter a valid message.

package examples import (

Button

Pair with Button to create a textarea with a submit button.

package examples import (

API Reference

Textarea

The Textarea component renders a native textarea element.

Prop Type Default
Name string -
Value string -
Placeholder string -
Rows int -
Disabled bool false
ReadOnly bool false
Required bool false
Class string -