npx shadcn@latest add https://chamaac.com/r/ai-input.json| Prop | Type | Default | Description |
|---|---|---|---|
| models | Model[] | DEFAULT_MODELS | Array of AI models to display in the model selector dropdown. Each model has id, name, label, and icon. |
| tools | ToolItem[] | DEFAULT_TOOLS | Array of tools to display in the tools dropdown. Each tool has an icon and label. |
| plusMenuItems | MenuItem[] | DEFAULT_PLUS_MENU | Array of items for the plus button menu. Each item has id, icon, and label. |
| onSubmit | (message: string, attachments: Attachment[]) => void | - | Callback function called when user submits a message. Receives the message text and array of attachments. |
| placeholder | string | "Ask anything..." | Placeholder text for the input textarea. |
| className | string | "" | Custom class names for styling the container. |
Generic dropdown component used for plus menu, tools, and model selection.
| Prop | Type | Default | Description |
|---|---|---|---|
| isOpen* | boolean | - | Whether the dropdown is open |
| onClose* | () => void | - | Callback when dropdown should close |
| items* | T[] | - | Array of items to display in the dropdown |
| renderItem | (item: T, index: number) => ReactNode | - | Custom render function for dropdown items |
| className | string | "" | Custom class names for styling |
Styled pill button with optional chevron and close button, used for tools and model selectors.
| Prop | Type | Default | Description |
|---|---|---|---|
| children* | React.ReactNode | - | Content to display inside the pill |
| isActive | boolean | false | Whether the pill is in active state |
| showChevron | boolean | false | Whether to show chevron indicator |
| chevronRotated | boolean | false | Whether chevron should be rotated (for open state) |
| showClose | boolean | false | Whether to show close (X) button |
| onClose | () => void | - | Callback when close button is clicked |
| onClick | () => void | - | Callback when pill is clicked |
| layoutId | string | - | Framer Motion layoutId for shared animations |
| icon | React.ComponentType | - | Icon component to display before children |
Message display area with auto-scroll and attachment previews.
| Prop | Type | Default | Description |
|---|---|---|---|
| messages* | Message[] | - | Array of messages to display |
| hasSubmitted* | boolean | - | Whether user has submitted at least one message |
| messagesEndRef* | React.RefObject<HTMLDivElement> | - | Ref for auto-scrolling to bottom |
Preview area for uploaded files with remove functionality.
| Prop | Type | Default | Description |
|---|---|---|---|
| files* | UploadedFile[] | - | Array of uploaded files to preview |
| onRemove* | (id: string) => void | - | Callback when remove button is clicked |