Skip to content
MarkasUI
Type to search

    Guide

    MarkasUI

    Form

    Feedback

    Overlay

    Navigation

    Data

    Sections

    Animations

    Backgrounds

    Buttons

    Templates

    Pages

    Textarea

    Multi-line text field with a label, hint, and error message linked through ARIA.

    Up to 200 characters.

    Address is incomplete.

    Up to 200 characters.

    Address is incomplete.

    Textarea

    <x-markas.textarea label="Message" placeholder="Type your message here" />
    import { Textarea } from "@/components/markas/Textarea";
    
    <Textarea label="Message" placeholder="Type your message here" />
    import Textarea from "@/components/markas/Textarea.vue";
    
    <Textarea label="Message" placeholder="Type your message here" />
    <script lang="ts">
      import Textarea from "$lib/components/markas/Textarea.svelte";
    </script>
    
    <div class="grid gap-4">
      <Textarea
        name="bio"
        label="Short bio"
        placeholder="Tell us a little about yourself"
        hint="Up to 200 characters."
      />
      <Textarea
        name="address"
        label="Address"
        rows={2}
        value="12 Main Street"
        error="Address is incomplete."
      />
    </div>
    ---
    import Textarea from "@/components/markas/Textarea.astro";
    ---
    
    <div class="grid gap-4">
      <Textarea
        name="bio"
        label="Short bio"
        placeholder="Tell us a little about yourself"
        hint="Up to 200 characters."
      />
      <Textarea
        name="address"
        label="Address"
        rows={2}
        value="12 Main Street"
        error="Address is incomplete."
      />
    </div>
    import { Component } from "@angular/core";
    import { Textarea } from "./markas/textarea.component";
    
    @Component({
      selector: "markas-example",
      imports: [Textarea],
      template: `
        <div class="grid gap-4">
          <markas-textarea
            name="bio"
            label="Short bio"
            placeholder="Tell us a little about yourself"
            hint="Up to 200 characters."
          />
          <markas-textarea
            name="address"
            label="Address"
            rows="2"
            value="12 Main Street"
            error="Address is incomplete."
          />
        </div>
      `,
    })
    export default class TextareaExample {}

    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.

    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

    Row heights

    Comment box

    Markdown is supported.

    Markdown is supported.

    Markdown is supported.

    Markdown is supported.

    Markdown is supported.

    Installation

    npx markasui@latest add textarea

    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 value prop because textarea has no value attribute.
    • The component has no built-in text. Every visible string comes from your props, so translate label, hint, and error directly.

    Props

    NameTypeDefaultDescription
    labelstring-Label text linked to the textarea through for/id.
    hintstring-Hint text below the textarea. Hidden while an error is shown.
    errorstring-Error message. Turns on aria-invalid and the danger border.
    rowsnumber4Number 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)].
    idstringautoTextarea 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.