aykan-ai-chat-search
v1.0.1
Published
AI Chat and Search components for React applications with modern UI design
Maintainers
Readme
AI Chat & Search Components
AI-powered chat and search components for React applications with modern UI design and Redux integration.
Installation
npm install @aykan/ai-chat-searchBasic Usage
import React from 'react';
import { AIChatWidget, AISearchBar } from '@aykan/ai-chat-search';
import '@aykan/ai-chat-search/dist/index.css';
function App() {
return (
<div>
<AISearchBar
onPerformSearch={(query) => console.log('Search:', query)}
results={[]}
searchInProgress={false}
searchError={null}
/>
<AIChatWidget />
</div>
);
}
export default App;Components
AIChatWidget
Main chat component with floating trigger button.
Props:
- Standard React component props
AISearchBar
AI search component with real-time results.
Props:
onPerformSearch(query): Function called when search is performedresults: Array of search resultssearchInProgress: Boolean indicating if search is in progresssearchError: Error object if search failed
Redux Components
For Redux integration, use the Redux versions:
import { AIChatWidgetRedux, ChatPopupRedux } from '@aykan/ai-chat-search';
import { chatReducer, searchReducer } from '@aykan/ai-chat-search';
// Add reducers to your store
const store = createStore(combineReducers({
chat: chatReducer,
search: searchReducer,
// your other reducers
}));Features
- Modern AI chat interface with glass morphism design
- AI-powered semantic search functionality
- Redux state management integration
- Responsive design for all devices
- Customizable themes and styling
- TypeScript support (coming soon)
Dependencies
This package requires the following peer dependencies:
react >= 16.8.0react-dom >= 16.8.0redux ^4.0.0react-redux ^7.0.0 || ^8.0.0
For full functionality, you may also need:
@ai-sdk/react(for AI features)react-markdown(for markdown rendering)remark-gfm(for GitHub flavored markdown)
Development
To build the package:
npm run buildTo watch for changes:
npm run build:watchLicense
MIT
