Skip to content
GitHub11 stars

Textarea

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

<Textarea placeholder="Type your message here." />

Installation

dnx Blazix.Cli add textarea

Usage

<Textarea />

Field

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

Enter your message below.

<Field>
    <FieldLabel for="textarea-message">Message</FieldLabel>
    <FieldDescription>Enter your message below.</FieldDescription>
    <Textarea id="textarea-message" placeholder="Type your message here." />
</Field>

Disabled

Use the disabled parameter to disable the textarea. To style the disabled state, add the data-disabled attribute to the Field component.

<Field data-disabled>
    <FieldLabel for="textarea-disabled">Message</FieldLabel>
    <Textarea id="textarea-disabled" placeholder="Type your message here." disabled />
</Field>

Invalid

Use the aria-invalid parameter to mark the textarea as invalid. To style the invalid state, add the data-invalid attribute to the Field component.

Please enter a valid message.

<Field data-invalid="true">
    <FieldLabel for="textarea-invalid">Message</FieldLabel>
    <Textarea id="textarea-invalid" placeholder="Type your message here." aria-invalid="true" />
    <FieldDescription>Please enter a valid message.</FieldDescription>
</Field>

Button

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

<div class="grid w-full gap-2">
    <Textarea placeholder="Type your message here." />
    <Button>Send message</Button>
</div>

RTL

To enable RTL support in Blazix, see the RTL configuration guide.

Translated with AI for the demo, so it may have mistakes.

شاركنا أفكارك حول خدمتنا.

<Field Class="w-full max-w-xs">
    <FieldLabel for="textarea-rtl-feedback">@T.Label</FieldLabel>
    <Textarea id="textarea-rtl-feedback" placeholder="@T.Placeholder" rows="4" />