shadcn.io is not affiliated with official shadcn/ui
Input Group examples · Textarea
Code Editor Input Group for React
A code box with a file name and refresh button above it and the cursor position and a Run button below it.
An editor frame around a plain textarea: a header with the file name script.js and a refresh button, and a footer with Line 1, Column 1 and a Run button. Both rows are bordered addons, block-start and block-end.
Preview
Installation
FAQ
How is the header built?
An InputGroupAddon with align="block-start" and border-b: an InputGroupText with a file icon and script.js in font-mono, and an icon-only Refresh button pushed to the end with ms-auto.
How is the footer built?
An InputGroupAddon with align="block-end" and border-t: the position text and a Run button with a return icon, pushed to the end.
Why is the footer before the header in the code?
Order between addons doesn't matter: align places each one. Only the textarea needs to come first.
Does Line 1, Column 1 follow the cursor?
No, it's fixed text. Compute it from the textarea's selection start on select and key events.
Related
- Character Counter Input Group (Textarea)A message textarea with its 500-character
- Rich Text Toolbar Input GroupA textarea with bold, italic, underline
- Textarea with Toolbar Input GroupA textarea with bold, italic and
- Textarea with Actions Input GroupA message textarea with a Submit button
- AI Prompt Input Input GroupAn AI prompt box with a mode menu, a
- Chat Input Input GroupA chat message box with an emoji button