Skip to content

Text Area

Accepts multiline text input from users.

No props are required to display <TextArea>, but it’s recommended to provide a label for accessibility.

import { TextArea } from "stylus-ui/TextArea";
export default () => <TextArea label="Bio" />;

To display additional info beneath the input, pass in helpText.

Tell teammates what you do.

import { TextArea } from "stylus-ui/TextArea";
export default () => (
<TextArea label="Bio" helpText="Tell teammates what you do." />
);

When displaying an input in a space-constrained location, you can pass small, which decreases the padding and font size and sets a smaller minimum height.

Tell teammates what you do.

import { TextArea } from "stylus-ui/TextArea";
export default () => (
<TextArea label="Bio" helpText="Tell teammates what you do." small />
);

When displaying an error message, pass error to highlight the input in red.

Tell teammates what you do.

import { TextArea } from "stylus-ui/TextArea";
export default () => (
<TextArea label="Bio" helpText="Tell teammates what you do." error />
);

Placeholder text may be used to provide an example of input to the user.

import { TextArea } from "stylus-ui/TextArea";
export default () => <TextArea label="Bio" placeholder="What do you do?" />;
import { TextArea } from "stylus-ui/TextArea";
export default () => <TextArea label="Bio" disabled />;

By default, <TextArea> can be dragged from the corner to vertically resize the input. To disable this, pass resize={false}. Notice the lack of a drag handle in the bottom right.

import { TextArea } from "stylus-ui/TextArea";
export default () => <TextArea resize={false} />;

Accepts multiline text input from users.

error

boolean = false

Show error state with error-coloured border, text, and placeholder.


helpText

string

Helper or error text shown below the textarea.


label

string

Label shown above the textarea.


resize

boolean = true

Allow vertical resize handle.


small

boolean = false

Use smaller height and text size.


theme

"light" | "dark" = "light"

Visual theme for background and outline.