Skip to content
Page

Textarea

Multi-line text entry.

import { Textarea } from "@pelagornis/page/components";

The preview above renders this file. Copy it into src/components/ to start from it.

src/components/TextareaExample.tsx
import { Stack, Textarea } from "@pelagornis/page/components";
export default function TextareaDemo() {
return (
<Stack gap="sizeSmall" className="w-full max-w-sm">
<Textarea placeholder="Write a comment…" rows={4} aria-label="Comment" fullWidth />
<Textarea error defaultValue="Too short" rows={2} aria-label="Error" fullWidth />
</Stack>
);
}

Textarea can be written straight in an .mdx page. Import it below the frontmatter. It renders on the server, so no client directive is needed.

src/content/docs/example.mdx
---
title: Example
---
import { Textarea } from "@pelagornis/page/components";
<Textarea placeholder="Write a comment…" rows={4} aria-label="Comment" />

pageMarkdoc() registers a textarea tag for this component. Add the preset once in markdoc.config.mjs (see Use in Markdoc), then write the tag in any .mdoc page.

src/content/docs/example.mdoc
{% textarea placeholder="Write a comment…" rows=4 ariaLabel="Comment" /%}

Attributes use the same names and values as the React props.

Parts of the component and the data-refineui role each one renders.

PartRole
roottextarea