Skip to content

Commit 7633aae

Browse files
committed
docs: Add custom icon example
1 parent f8adcc0 commit 7633aae

9 files changed

+54
-8
lines changed

docs/examples/custom_events.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 19
2+
sidebar_position: 20
33
title: Custom Events
44
description: custom events chatbot example
55
keywords: [react, chat, chatbot, chatbotify]

docs/examples/custom_hooks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 20
2+
sidebar_position: 21
33
title: Custom Hooks
44
description: custom hooks chatbot example
55
keywords: [react, chat, chatbot, chatbotify]

docs/examples/custom_icon.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
sidebar_position: 13
3+
title: Custom Icon
4+
description: custom icon chatbot example
5+
keywords: [react, chat, chatbot, chatbotify]
6+
---
7+
8+
# Custom Icon
9+
10+
The following is an example for using a custom icon for audio button, as well as changing the color of the icon for the notification button. For the audio button, this example provides an **image URL** to modify it. Note that you can also import a **SVG component** directly if you wish. The benefit of importing a SVG component is that you can modify it using css e.g. `fill: "red"`. The notification button demonstrates the modification of the icon color (the library by default **imports all icons as SVG components** to ease customisations).
11+
12+
```jsx live noInline title=MyChatBot.js
13+
const MyChatBot = () => {
14+
const flow={
15+
start: {
16+
message: "Check out the audio and notification button icons!"
17+
}
18+
}
19+
20+
const settings = {
21+
audio: {
22+
// can also import and use svg components directly instead of image url
23+
icon: "https://cdn4.iconfinder.com/data/icons/web-ui-color/128/Audio-512.png",
24+
iconDisabled: "https://cdn4.iconfinder.com/data/icons/web-ui-color/128/Audio-512.png",
25+
disabled: false
26+
},
27+
general: {
28+
embedded: true
29+
},
30+
chatHistory: {
31+
storageKey: "example_custom_icon"
32+
}
33+
}
34+
35+
const styles = {
36+
notificationIconStyle: {
37+
fill: "pink"
38+
}
39+
}
40+
return (
41+
<ChatBot settings={settings} styles={styles} flow={flow}/>
42+
);
43+
};
44+
45+
render(<MyChatBot/>)
46+
```

docs/examples/markup_message.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 16
2+
sidebar_position: 17
33
title: Markup Message
44
description: markup message chatbot example
55
keywords: [react, chat, chatbot, chatbotify]

docs/examples/multiple_themes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 18
2+
sidebar_position: 19
33
title: Multiple Themes
44
description: multiple themes chatbot example
55
keywords: [react, chat, chatbot, chatbotify]

docs/examples/sensitive_input.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 15
2+
sidebar_position: 16
33
title: Sensitive Input
44
description: sensitive input chatbot example
55
keywords: [react, chat, chatbot, chatbotify]

docs/examples/single_theme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 17
2+
sidebar_position: 18
33
title: Single Theme
44
description: single theme chatbot example
55
keywords: [react, chat, chatbot, chatbotify]

docs/examples/smart_conversation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 14
2+
sidebar_position: 15
33
title: Smart Conversation
44
description: smart conversation chatbot example
55
keywords: [react, chat, chatbot, chatbotify]

docs/examples/smart_welcome.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 13
2+
sidebar_position: 14
33
title: Smart Welcome
44
description: smart welcome chatbot example
55
keywords: [react, chat, chatbot, chatbotify]

0 commit comments

Comments
 (0)