shadcn.io is not affiliated with official shadcn/ui
Input Group examples · Textarea
Chat Input Input Group for React
A chat message box with an emoji button, a character limit and a Send button in its footer.
A chat composer: a textarea, then a bordered footer with an emoji button, a 0/2000 count and a Send button with a send icon. All the footer parts share one block-end addon.
Preview
Installation
FAQ
How is the footer laid out?
One InputGroupAddon with align="block-end" and border-t. The emoji button comes first, ms-auto sends the count to the end and ms-2 spaces Send from it.
What does the emoji button do?
Nothing in the demo. It's an icon-only InputGroupButton named Emoji; open a picker from it.
How is Send built?
InputGroupButton with size="sm" and variant="default", its icon after the text with data-icon="inline-end".
How do I send on Enter?
Handle the key down on the textarea: on Enter without Shift, prevent the newline and send. Shift+Enter keeps its new line.
Related
- AI Prompt Input Input GroupAn AI prompt box with a mode menu, a
- Character Counter Input Group (Textarea)A message textarea with its 500-character
- Textarea with Counter Input GroupA message textarea with a 500-character
- Multiple Action Buttons Input GroupA read-only link with an info button and
- AI with Voice Input GroupAn AI prompt box with attach and voice
- Input with LabelA text input with a label above it