Multi-line text field with a label, hint, and error message linked through ARIA.
Message is required
Message is required
Up to 200 characters.
Address is incomplete.
Up to 200 characters.
Address is incomplete.
<x-markas.textarea label="Message" placeholder="Type your message here" /><x-markas.textarea label="Message" placeholder="Type your message here" disabled /><x-markas.textarea label="Message" placeholder="Type your message here" error="Message is required" /><x-markas.textarea
label="Message"
placeholder="Type your message here"
error="Message is required"
disabled
/>import { Textarea } from "@/components/markas/Textarea";
<Textarea label="Message" placeholder="Type your message here" />import { Textarea } from "@/components/markas/Textarea";
<Textarea label="Message" placeholder="Type your message here" disabled />import { Textarea } from "@/components/markas/Textarea";
<Textarea label="Message" placeholder="Type your message here" error="Message is required" />import { Textarea } from "@/components/markas/Textarea";
<Textarea
label="Message"
placeholder="Type your message here"
error="Message is required"
disabled
/>import Textarea from "@/components/markas/Textarea.vue";
<Textarea label="Message" placeholder="Type your message here" />import Textarea from "@/components/markas/Textarea.vue";
<Textarea label="Message" placeholder="Type your message here" disabled />import Textarea from "@/components/markas/Textarea.vue";
<Textarea label="Message" placeholder="Type your message here" error="Message is required" />import Textarea from "@/components/markas/Textarea.vue";
<Textarea
label="Message"
placeholder="Type your message here"
error="Message is required"
disabled
/>Examples
States
Shown on your public profile.
Please describe the issue in at least 20 characters.
Shown on your public profile.
Please describe the issue in at least 20 characters.
Shown on your public profile.
Please describe the issue in at least 20 characters.
Shown on your public profile.
Please describe the issue in at least 20 characters.
Shown on your public profile.
Please describe the issue in at least 20 characters.
<div class="grid gap-4">
<x-markas.textarea name="bio" label="Short bio" :rows="3" placeholder="Tell us a little about yourself" hint="Shown on your public profile." />
<x-markas.textarea name="reason" label="Reason for refund" :rows="3" value="Wrong size" error="Please describe the issue in at least 20 characters." />
<x-markas.textarea name="notes" label="Internal notes" :rows="3" value="Customer upgraded to the Pro plan on 3 March." disabled />
</div>Character count
Visible to everyone in the project.
91 / 200
Visible to everyone in the project.
91 / 200
Visible to everyone in the project.
91 / 200
Visible to everyone in the project.
91 / 200
Visible to everyone in the project.
91 / 200
<div class="grid gap-1.5">
<x-markas.textarea name="summary" label="Summary" :rows="3" maxlength="200" value="Weekly sync moves to Thursday at 10:00. Please review the roadmap draft before the meeting." />
<div class="flex justify-between gap-4 text-sm text-muted">
<p>Visible to everyone in the project.</p>
<p>91 / 200</p>
</div>
</div>Row heights
<div class="grid gap-4">
<x-markas.textarea name="headline" label="Headline" :rows="2" placeholder="One or two sentences" />
<x-markas.textarea name="description" label="Description" :rows="6" placeholder="Describe the change, why it matters, and how to test it" />
<x-markas.textarea name="address" label="Shipping address" :rows="3" placeholder="Street, city, postal code" class="resize-none" />
</div>Comment box
Markdown is supported.
Markdown is supported.
Markdown is supported.
Markdown is supported.
Markdown is supported.
<div class="grid gap-3 rounded-lg border border-line bg-surface p-4">
<x-markas.textarea name="comment" aria-label="Comment" :rows="3" placeholder="Leave a comment" />
<div class="flex items-center justify-between gap-4">
<p class="text-sm text-muted">Markdown is supported.</p>
<div class="flex gap-2">
<x-markas.button variant="ghost" size="sm">Cancel</x-markas.button>
<x-markas.button size="sm">Comment</x-markas.button>
</div>
</div>
</div>Installation
npx markasui@latest add textareapnpm dlx markasui@latest add textareayarn dlx markasui@latest add textareabunx --bun markasui@latest add textarea- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
resources/views/components/markas/textarea.blade.php.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Textarea.tsx.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Textarea.vue.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/lib/components/markas/Textarea.svelte.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Textarea.astro.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/app/markas/textarea.component.ts.
Usage
<x-markas.textarea name="bio" label="Short bio" hint="Up to 200 characters." />
<x-markas.textarea name="address" label="Address" :rows="2" :value="old('address')" :error="$errors->first('address')" />import { Textarea } from "@/components/markas/Textarea";
<Textarea name="bio" label="Short bio" hint="Up to 200 characters." />
<Textarea name="address" label="Address" rows={2} error={errors.address} /><script setup lang="ts">
import { ref } from "vue";
import Textarea from "@/components/markas/Textarea.vue";
const bio = ref("");
</script>
<template>
<Textarea
v-model="bio"
name="bio"
label="Short bio"
hint="Up to 200 characters."
/>
</template><script lang="ts">
import Textarea from "$lib/components/markas/Textarea.svelte";
let bio = $state("");
</script>
<Textarea
bind:value={bio}
name="bio"
label="Short bio"
hint="Up to 200 characters."
/>---
import Textarea from "@/components/markas/Textarea.astro";
---
<Textarea name="bio" label="Short bio" hint="Up to 200 characters." />
<Textarea name="address" label="Address" rows={2} value="12 Main Street" error="Address is incomplete." />No client script. Pass the initial content through value, as in Blade.
import { Component, signal } from "@angular/core";
import { Textarea } from "./markas/textarea.component";
@Component({
selector: "app-profile",
imports: [Textarea],
template: `
<markas-textarea
[(value)]="bio"
name="bio"
label="Short bio"
hint="Up to 200 characters."
/>
`,
})
export class Profile {
readonly bio = signal("");
}- Extra attributes (
name,placeholder,maxlength,class) go to the<textarea>element, not its wrapper. - In Blade, pass the initial content through the
valueprop because textarea has no value attribute. - The component has no built-in text. Every visible string comes from your props, so translate
label,hint, anderrordirectly.
Props
| Name | Type | Default | Description |
|---|---|---|---|
label | string | - | Label text linked to the textarea through for/id. |
hint | string | - | Hint text below the textarea. Hidden while an error is shown. |
error | string | - | Error message. Turns on aria-invalid and the danger border. |
rows | number | 4 | Number of visible rows. Users can still resize the height vertically. |
value / defaultValue / v-model / bind:value / [(value)] | string | - | Initial content. Blade and Astro use the value prop, React value or defaultValue, Vue v-model, Svelte bind:value, Angular value or [(value)]. |
id | string | auto | Textarea id. Generated when empty. |
Accessibility
- The label is linked to the textarea through the for and id attributes.
- Error and hint text are announced by screen readers through aria-describedby.
- aria-invalid is set when the error prop is filled.
Related components
More form components with the same classes in every framework.
- ButtonButton with primary, secondary, ghost, and danger variants.
- CheckboxNative checkbox with an optional label and description, custom styled without JavaScript.
- ComboboxText input with a filtered suggestion list in a popover, following the WAI-ARIA Combobox pattern with list autocomplete.
- InputText field with a label, hint, and error message wired up through ARIA.
- Input OTPOne-time code input split into single-digit boxes, with auto advance, paste support, and one hidden field for form submit.
- LabelForm label with consistent styling and optional required or optional markers that screen readers announce correctly.