Propel

Text Area Field

A labeled multi-line text field with optional description, hint, and error messaging.

Basic

Share your thoughts on the proposal.

Markdown is supported.

Show code
import { TextAreaField } from "@makeplane/propel/components/text-area-field";

export default function BasicDemo() {
  return (
    <TextAreaField
      magnitude="md"
      resize="vertical"
      label="Comment"
      placeholder="Leave a comment..."
      description="Share your thoughts on the proposal."
      hint="Markdown is supported."
    />
  );
}

Magnitudes

magnitude steps the value font-size and the field min-height; padding and radius stay fixed.

Show code
import { TextAreaField } from "@makeplane/propel/components/text-area-field";

export default function MagnitudesDemo() {
  return (
    <div className="flex flex-col items-start gap-4">
      <TextAreaField magnitude="md" resize="vertical" label="md" placeholder="Leave a comment..." />
      <TextAreaField magnitude="lg" resize="vertical" label="lg" placeholder="Leave a comment..." />
      <TextAreaField magnitude="xl" resize="vertical" label="xl" placeholder="Leave a comment..." />
    </div>
  );
}

Invalid

Setting error overrides hint, marks the field invalid (aria-invalid), and recolors the border to danger.

Add a little more detail.
Show code
import { TextAreaField } from "@makeplane/propel/components/text-area-field";

export default function InvalidDemo() {
  return (
    <TextAreaField
      magnitude="md"
      resize="vertical"
      label="Comment"
      defaultValue="No"
      error="Add a little more detail."
      required
    />
  );
}

Controlled

0 characters

Show code
import { TextAreaField } from "@makeplane/propel/components/text-area-field";
import * as React from "react";

export default function ControlledDemo() {
  const [value, setValue] = React.useState("");

  return (
    <TextAreaField
      magnitude="md"
      resize="vertical"
      label="Comment"
      placeholder="Leave a comment..."
      value={value}
      onChange={(event) => setValue(event.target.value)}
      hint={`${value.length} characters`}
    />
  );
}

Installation

import { TextAreaField } from "@makeplane/propel/components/text-area-field";

Props

TextAreaField

PropTypeRequiredDescription
resize"none" | "both" | "vertical"YesControls whether the user can resize the textarea (none, vertical, both).
magnitude"md" | "lg" | "xl"YesMagnitude scale. `md` | `lg` | `xl`.
labelstringNoLabel text shown above the control.
descriptionReactNodeNoSupporting text shown directly below the label.
hintReactNodeNoHelper text shown below the control. Replaced by `error` when an error is set.
errorReactNodeNoError text shown below the control. Overrides `hint` and marks the field invalid (danger border).