Customization
React SDK
Build custom chat interfaces with our React hooks and components
Our React SDK provides a powerful set of hooks and components to build custom chat interfaces while leveraging our chat infrastructure.
Installation
Quick Setup
Wrap your app with our WidgetRoot
provider:
Configuration Options
Available Hooks
useChat
The main hook for chat functionality:
useConfig
Access and update configuration:
useLocale
Handle internationalization:
useFeedback
Handle message feedback:
Building Custom Components
Message Components
Create custom message displays:
Input Components
Create custom input interfaces:
Best Practices
-
State Management
- Use hooks for managing local state
- Implement proper cleanup
- Handle loading and error states
-
Performance
- Memoize callbacks and computations
- Use virtualization for long lists
- Implement proper error boundaries
-
Accessibility
- Add ARIA labels and roles
- Support keyboard navigation
- Handle screen readers
-
User Experience
- Show loading states
- Provide clear error messages
- Add animations and transitions
-
Testing
- Test all user interactions
- Mock API responses
- Test error scenarios
Need help? Check our example repo or join our Discord community.
Was this page helpful?