@geoffai/elements
v0.1.0
Published
Reusable UI components for building AI chat interfaces
Downloads
122
Readme
@geoffai/elements
Reusable UI components for building AI chat interfaces. Framework-agnostic components with no AI SDK dependencies.
Installation
pnpm add @geoffai/elementsComponents
Chat Components
ChatContainer- Main chat container with flex layoutChatMessages- Scrollable messages container with auto-scrollChatScrollButton- Floating scroll-to-bottom buttonChatInputArea- Container for the chat input areaChatEmptyState- Empty state when no messages
Prompt Input
PromptInput- Form wrapper for inputPromptInputTextarea- Auto-resizing textarea with IME supportPromptInputToolbar- Toolbar containerPromptInputTools- Tool buttons groupPromptInputButton- Action buttonPromptInputSubmit- Submit button with status iconsPromptInputModelSelect- Model selector dropdown
Message Components
MessageContainer- Message wrapper with role-based alignmentMessageContent- Content box with role-based stylingMessageAvatar- Avatar componentMessageText- Prose-styled text wrapperMessageGroup- Groups multiple messagesMessageTimestamp- Timestamp display
Chain of Thought
ChainOfThought- Collapsible containerChainOfThoughtHeader- Toggle headerChainOfThoughtContent- Animated contentChainOfThoughtStep- Step with status iconChainOfThoughtSearchResults- Results containerChainOfThoughtSearchResult- Individual result
Thinking/Loading
Shimmer- Gradient text animationGeoffThinking- Animated fibonacci spiral dots
Media
ImageCard- Image display for generated imagesImageGrid- Grid layout for multiple imagesMusicPlayer- Audio player with waveform
UI Primitives
Button- Button with variantsTextarea- Text inputSelect- Dropdown selectCollapsible- Collapsible containerAvatar- User avatar
Hooks
useScrollToBottom- Scroll management for chat
Types
The package provides its own types that replace ai-sdk dependencies:
ChatStatus- 'idle' | 'submitted' | 'streaming' | 'error'Message- Base message interfaceChatHelpers- Chat state and methodsToolInvocation- Tool call dataGeneratedImage- Image generation resultLanguageModelUsage- Token usage stats
