shadcn.io is not affiliated with official shadcn/ui
Input Group examples · AI
AI with Voice Input Group for React
An AI prompt box with attach and voice buttons, a model menu and a send button under the textarea.
A prompt box that also takes voice and files. Under the textarea are an attach button, a microphone button, a Claude 3.5 model Dropdown Menu pushed to the end, a short divider and a round send button. The buttons are placeholders for your recording and upload logic.
Preview
Installation
FAQ
What sits under the prompt in this input?
One InputGroupAddon with align="block-end", written after InputGroupTextarea: the paperclip button, the mic button, the model menu, a vertical Separator and the send button.
What do the paperclip and mic buttons do?
Nothing yet: they're ghost, icon-only InputGroupButtons named Attach and Voice input. Start your file picker or recording from them.
How is the Claude model menu built?
The trigger is an InputGroupButton labeled Claude 3.5, with ms-auto so it and everything after it sit at the end. DropdownMenuTrigger renders the InputGroupButton through render. The menu opens above the row, aligned to the end. side="top" and align="end" on DropdownMenuContent place it. The label doesn't change when you pick a model: keep the choice in state and render it in the trigger.
What is the short line before the send button?
A Separator with orientation="vertical" and h-4!, which keeps it shorter than the row.
Related
- AI Prompt Input Input GroupAn AI prompt box with a mode menu, a
- Simple AI Prompt Input GroupAn AI prompt box with an enhance button
- AI with Attachments Input GroupAn AI prompt box with an attachment menu
- Copy Button Input GroupA read-only link with a copy button that
- Simple Dropdown with Icons Dropdown MenuA short menu behind a dots button with an
- Search with Icon Input GroupA search input with a magnifying glass at