@@ -10,7 +10,6 @@ A modern React component library with embeddable voice and chat widgets built wi
10
10
- 💬 ** Chat Interface** : Text-based conversations with markdown support
11
11
- 🔀 ** Hybrid Mode** : Seamlessly switch between voice and chat
12
12
- 🎨 ** Highly Customizable** : Themes, colors, sizes, and positions
13
- - 📱 ** Responsive Design** : Works on desktop and mobile devices
14
13
- 🔒 ** Consent Management** : Built-in consent form for compliance
15
14
- ⚡ ** Easy Integration** : Use as React component or embed in any HTML page
16
15
- 📘 ** TypeScript** : Full type safety and IntelliSense support
@@ -40,6 +39,13 @@ The simplest way to add the widget to your website:
40
39
mode =" chat"
41
40
theme =" light"
42
41
size =" full"
42
+ color-accent =" #3B82F6"
43
+ cta-button-color =" #1F2937"
44
+ cta-button-text-color =" #FFFFFF"
45
+ title =" AI Assistant"
46
+ cta-title =" Chat with us"
47
+ cta-subtitle =" 24/7 Support"
48
+ chat-placeholder =" How can I help you today?"
43
49
></vapi-widget >
44
50
</body >
45
51
</html >
@@ -65,39 +71,49 @@ The simplest way to add the widget to your website:
65
71
66
72
### Optional Props
67
73
68
- | Prop | Type | Default | Description |
69
- | ------------------------- | -------------------------------------------------------------- | ----------------------- | ---------------------------------- |
70
- | ` mode ` | ` 'voice' \| 'chat' \| 'hybrid' ` | ` 'chat' ` | Widget interaction mode |
71
- | ` theme ` | ` 'light' \| 'dark' ` | ` 'light' ` | Color theme |
72
- | ` position ` | ` 'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left' ` | ` 'bottom-right' ` | Screen position |
73
- | ` size ` | ` 'tiny' \| 'compact' \| 'full' ` | ` 'full' ` | Widget size |
74
- | ` radius ` | ` 'none' \| 'small' \| 'medium' \| 'large' ` | ` 'medium' ` | Border radius |
75
- | ` apiUrl ` | ` string ` | - | Custom API endpoint for chat mode |
76
- | ` baseColor ` | ` string ` | - | Main background color |
77
- | ` accentColor ` | ` string ` | ` '#14B8A6' ` | Primary accent color |
78
- | ` buttonBaseColor ` | ` string ` | ` '#000000' ` | Floating button background |
79
- | ` buttonAccentColor ` | ` string ` | ` '#FFFFFF' ` | Floating button text/icon color |
80
- | ` mainLabel ` | ` string ` | ` 'Talk with AI' ` | Widget header text |
81
- | ` startButtonText ` | ` string ` | ` 'Start' ` | Voice call start button text |
82
- | ` endButtonText ` | ` string ` | ` 'End Call' ` | Voice call end button text |
83
- | ` emptyVoiceMessage ` | ` string ` | - | Message when voice mode is empty |
84
- | ` emptyVoiceActiveMessage ` | ` string ` | - | Message during active voice call |
85
- | ` emptyChatMessage ` | ` string ` | - | Message when chat is empty |
86
- | ` emptyHybridMessage ` | ` string ` | - | Message for hybrid mode |
87
- | ` firstChatMessage ` | ` string ` | - | Initial assistant message in chat |
88
- | ` requireConsent ` | ` boolean ` | ` false ` | Show consent form before first use |
89
- | ` termsContent ` | ` string ` | _ (default message)_ | Terms & conditions text |
90
- | ` localStorageKey ` | ` string ` | ` "vapi_widget_consent" ` | Key for storing consent |
91
- | ` showTranscript ` | ` boolean ` | ` false ` | Show/hide voice transcript |
74
+ | Prop | Type | Default | Description |
75
+ | ------------------------- | --------------------------------------------------------------------------------- | ------------------------ | ---------------------------------- |
76
+ | ` mode ` | ` 'voice' \| 'chat' \| 'hybrid' ` | ` 'chat' ` | Widget interaction mode |
77
+ | ` theme ` | ` 'light' \| 'dark' ` | ` 'light' ` | Color theme |
78
+ | ` position ` | ` 'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left' \| 'bottom-center' ` | ` 'bottom-right' ` | Screen position |
79
+ | ` size ` | ` 'tiny' \| 'compact' \| 'full' ` | ` 'full' ` | Widget size |
80
+ | ` borderRadius ` | ` 'none' \| 'small' \| 'medium' \| 'large' ` | ` 'medium' ` | Corner radius style |
81
+ | ` apiUrl ` | ` string ` | - | Custom API endpoint for chat mode |
82
+ | ** Colors** | | | |
83
+ | ` baseBgColor ` | ` string ` | - | Main background color |
84
+ | ` accentColor ` | ` string ` | ` '#14B8A6' ` | Primary accent color |
85
+ | ` ctaButtonColor ` | ` string ` | ` '#000000' ` | CTA button background color |
86
+ | ` ctaButtonTextColor ` | ` string ` | ` '#FFFFFF' ` | CTA button text/icon color |
87
+ | ** Text Labels** | | | |
88
+ | ` title ` | ` string ` | ` 'Talk with AI' ` | Main widget title |
89
+ | ` startButtonText ` | ` string ` | ` 'Start' ` | Voice call start button text |
90
+ | ` endButtonText ` | ` string ` | ` 'End Call' ` | Voice call end button text |
91
+ | ` ctaTitle ` | ` string ` | _ (uses title)_ | Floating button main text |
92
+ | ` ctaSubtitle ` | ` string ` | - | Floating button subtitle text |
93
+ | ** Empty States** | | | |
94
+ | ` voiceEmptyMessage ` | ` string ` | - | Message when voice mode is empty |
95
+ | ` voiceActiveEmptyMessage ` | ` string ` | - | Message during active voice call |
96
+ | ` chatEmptyMessage ` | ` string ` | - | Message when chat is empty |
97
+ | ` hybridEmptyMessage ` | ` string ` | - | Message for hybrid mode |
98
+ | ** Chat Configuration** | | | |
99
+ | ` chatFirstMessage ` | ` string ` | - | Initial assistant message in chat |
100
+ | ` chatPlaceholder ` | ` string ` | ` 'Type your message...' ` | Chat input placeholder text |
101
+ | ** Voice Configuration** | | | |
102
+ | ` voiceShowTranscript ` | ` boolean ` | ` false ` | Show/hide voice transcript |
103
+ | ** Consent Configuration** | | | |
104
+ | ` consentRequired ` | ` boolean ` | ` false ` | Show consent form before first use |
105
+ | ` consentTitle ` | ` string ` | ` "Terms and conditions" ` | Consent form title |
106
+ | ` consentContent ` | ` string ` | _ (default message)_ | Terms & conditions content |
107
+ | ` consentStorageKey ` | ` string ` | ` "vapi_widget_consent" ` | Key for storing consent |
92
108
93
109
### Event Callbacks
94
110
95
- | Prop | Type | Description |
96
- | ------------- | ------------------------ | -------------------------------- |
97
- | ` onCallStart ` | ` () => void ` | Triggered when voice call starts |
98
- | ` onCallEnd ` | ` () => void ` | Triggered when voice call ends |
99
- | ` onMessage ` | ` (message: any) => void ` | Triggered for all messages |
100
- | ` onError ` | ` (error: Error) => void ` | Triggered on errors |
111
+ | Prop | Type | Description |
112
+ | -------------- | ------------------------ | -------------------------------- |
113
+ | ` onVoiceStart ` | ` () => void ` | Triggered when voice call starts |
114
+ | ` onVoiceEnd ` | ` () => void ` | Triggered when voice call ends |
115
+ | ` onMessage ` | ` (message: any) => void ` | Triggered for all messages |
116
+ | ` onError ` | ` (error: Error) => void ` | Triggered on errors |
101
117
102
118
## React Component Usage
103
119
@@ -115,6 +131,9 @@ function App() {
115
131
position = " bottom-right"
116
132
theme = " light"
117
133
accentColor = " #3B82F6"
134
+ title = " AI Assistant"
135
+ chatPlaceholder = " Ask me anything..."
136
+ voiceShowTranscript = { true }
118
137
/>
119
138
);
120
139
}
@@ -133,8 +152,9 @@ Use the widget as a custom HTML element with kebab-case attributes - the cleanes
133
152
mode =" chat"
134
153
theme =" dark"
135
154
accent-color =" #8B5CF6"
136
- require-consent =" true"
137
- first-chat-message =" Welcome! How can I assist you?"
155
+ consent-required =" true"
156
+ chat-first-message =" Welcome! How can I assist you?"
157
+ chat-placeholder =" Type your question here..."
138
158
></vapi-widget >
139
159
```
140
160
@@ -163,7 +183,9 @@ Use this approach if your environment doesn't support custom elements or for bet
163
183
assistantId = " asst_456"
164
184
mode = " voice"
165
185
size = " tiny"
166
- showTranscript = { false }
186
+ voiceShowTranscript = { false }
187
+ startButtonText = " Call"
188
+ endButtonText = " Hang Up"
167
189
/>
168
190
```
169
191
@@ -176,7 +198,8 @@ Use this approach if your environment doesn't support custom elements or for bet
176
198
mode = " chat"
177
199
theme = " dark"
178
200
accentColor = " #8B5CF6"
179
- firstChatMessage = " Hello! How can I help you today?"
201
+ chatFirstMessage = " Hello! How can I help you today?"
202
+ chatPlaceholder = " Type your message here..."
180
203
/>
181
204
```
182
205
@@ -190,8 +213,11 @@ Use this approach if your environment doesn't support custom elements or for bet
190
213
variableValues: { name: ' John' },
191
214
}}
192
215
mode = " hybrid"
193
- requireConsent = { true }
194
- termsContent = " By using this service, you agree to our terms..."
216
+ consentRequired = { true }
217
+ consentTitle = " Privacy Agreement"
218
+ consentContent = " By using this service, you agree to our terms..."
219
+ title = " Support Assistant"
220
+ hybridEmptyMessage = " Start a conversation with voice or text"
195
221
onMessage = { (msg ) => console .log (' Message:' , msg )}
196
222
/>
197
223
```
@@ -223,11 +249,28 @@ Use this approach if your environment doesn't support custom elements or for bet
223
249
<VapiWidget
224
250
publicKey = " pk_123"
225
251
assistantId = " asst_456"
226
- baseColor = " #1a1a1a"
252
+ baseBgColor = " #1a1a1a"
227
253
accentColor = " #ff6b6b"
228
- buttonBaseColor = " #2a2a2a"
229
- buttonAccentColor = " #ffffff"
230
- radius = " large"
254
+ ctaButtonColor = " #2a2a2a"
255
+ ctaButtonTextColor = " #ffffff"
256
+ borderRadius = " large"
257
+ size = " full"
258
+ title = " Premium Support"
259
+ />
260
+ ```
261
+
262
+ ### Floating Button with Custom CTA
263
+
264
+ ``` tsx
265
+ <VapiWidget
266
+ publicKey = " pk_123"
267
+ assistantId = " asst_456"
268
+ mode = " hybrid"
269
+ position = " bottom-center"
270
+ title = " Customer Support Portal"
271
+ ctaTitle = " Need Help?"
272
+ ctaSubtitle = " Chat with our AI assistant"
273
+ accentColor = " #10b981"
231
274
size = " full"
232
275
/>
233
276
```
0 commit comments