AI Elements
Chat interfaces, prompt inputs, and message components for building AI-powered music tools like Tansen.
rds-ai-elementsVercel AI SDKTansen
01AiMessage
U
user
What key is this track in?
AI
assistant
Based on the chord progression, this track is in A minor. The recurring Am–F–C–G pattern is the giveaway.
U
user
Can you suggest a matching tempo?
AI
assistant
The current feel sits around 92–96 BPM, which works well for the genre. Going up to 104 BPM would give it more energy without losing the groove.▌
PROPTYPEDEFAULTDESCRIPTION
role"user" | "assistant" | "system"—Determines bubble alignment and avatarcontentstring—Message textisStreamingbooleanfalseShows a blinking cursor to indicate live streamingavatarUrlstring—Custom avatar image URLtimestampDate—Message timestamp shown below the sender nameactionsReactNode—Optional action buttons rendered below the bubble02AiPrompt
PROPTYPEDEFAULTDESCRIPTION
placeholderstring"What would you like to know?"Textarea placeholdersuggestionsstring[][]Quick-select prompt chips shown above the inputonSubmit(prompt: string) => void—Called on Enter or submit button clickonSuggestionClick(suggestion: string) => void—Called when a suggestion chip is clickedisGeneratingbooleanfalseDisables input and shows spinner while AI respondsdisabledbooleanfalseDisables the entire input03AiChat
Tansen AI
Hi! I'm Tansen. Ask me anything about your music.
PROPTYPEDEFAULTDESCRIPTION
titlestring"AI Assistant"Chat panel header titlemessagesRdsAiChatMessage[][]Array of messages to renderisGeneratingbooleanfalseShows typing indicator and disables inputonSend(message: string) => void—Called when user submits a messageplaceholderstring"Ask me anything..."Input placeholder text04Installation
bash
npm install @meinc/rds-ai-elementsimport { RdsAiChat, RdsAiMessage, RdsAiPrompt,} from "@meinc/rds-ai-elements"