Skip to content

shadcn.io is an independent project built on shadcn/ui

Free

Disabled Textarea for Solid

A disabled textarea that is dimmed, with the placeholder This textarea is disabled, and it cannot be edited.

UI library: Ark UI

A textarea is dimmed and shows the placeholder This textarea is disabled. Its accessible name is Message. It cannot be focused or edited.

Use it for a field that is unavailable, such as one locked until another choice is made. If people should still select and copy the text, keep it read-only instead. One line belongs in an Input. In Solid, Ark UI does not explain why it is off.

Preview

Preview width

Installation

MCP · Pro
Make your AI a shadcn expert
Your agent installs components, builds pages and restyles your app from one prompt, in Claude Code, Cursor or VS Code.
Part of Pro

Anatomy

Textarea anatomy: textarea, caret, placeholder, resize handle

Usage

<Textarea aria-label="Message" class="max-w-md bg-background" disabled placeholder="This textarea is disabled" />

FAQ

What's the difference between disabled and readOnly?

A disabled Textarea is dimmed, can't be focused, is skipped by Tab, and its value is left out when the form submits. A readOnly one looks like any other field, can be focused, lets people select and copy its text, and submits its value. Use disabled when the field doesn't apply yet, and readOnly when the value should be seen and sent but not changed, as in the Read-only Textarea example.

Can I customize the styling of disabled textareas?

Yes. The Textarea already has disabled:opacity-50 and disabled:cursor-not-allowed, and classes you pass with the disabled: variant add to them, for example disabled:bg-muted. Keep the state clearly different from an editable field, since the styling is the only cue sighted users get.

How do I conditionally enable or disable a textarea?

Bind disabled to a boolean from your component's state, such as a saving flag or a permission check, instead of hard-coding it. The Textarea turns editable again as soon as the value is false.

Should I show a tooltip explaining why the textarea is disabled?

Explain it, but in visible text such as a FieldDescription under the field. A tooltip on the Textarea itself never opens for keyboard users, because a disabled field can't receive focus, and touch users have no hover to open it.

Do screen readers announce disabled textareas correctly?

Yes: the native disabled attribute is announced as dimmed or unavailable. The field still needs an accessible name; this demo has no visible label, so it sets aria-label. Pair a real form's Textarea with a FieldLabel instead.

Are disabled textarea values included in form submissions?

No. Browsers leave disabled controls out of the form data, so the server never receives the value. If the value must be submitted but not edited, use readOnly, or send it from a hidden input with the same name.

API Reference

Textarea

Sets aria-label="Message", disabled and placeholder="This textarea is disabled". The rest is on the Textarea page.