Skip to content

Commit 2087b76

Browse files
committed
(docs) add formatMessages prop
1 parent 37b6d68 commit 2087b76

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ You can import it as a custom component:
101101
| showFiles | Boolean | - | true |
102102
| showEmojis | Boolean | - | true |
103103
| showReactionEmojis | Boolean | - | true |
104-
| textMessages (7) | Object | - | null |
105-
| responsiveBreakpoint (8) | Number | - | 900 |
106-
| singleRoom (9) | Number | - | false |
107-
| theme (10) | Sring | - | light |
108-
| styles (11) | Object | - | (10) |
104+
| formatMessages (7) | Boolean | - | true |
105+
| textMessages (8) | Object | - | null |
106+
| responsiveBreakpoint (9) | Number | - | 900 |
107+
| singleRoom (10) | Number | - | false |
108+
| theme (11) | Sring | - | light |
109+
| styles (12) | Object | - | (10) |
109110

110111
(1) `currentUserId` is required to display UI and trigger actions according to the user using the chat (ex: messages position on the right, etc.)
111112

@@ -188,13 +189,23 @@ textMessages="{
188189
}"
189190
```
190191

191-
(8) `responsiveBreakpoint` can be used to collapse the rooms list on the left when then viewport size goes below the specified width.
192+
(8) `formatMessages` can be used to add text formatting. Currently, bold, italic, strikethrough and underline formatting are available. All text formatting can be used in conjonction. Ex:
192193

193-
(9) `singleRoom` can be used if you never want to show the rooms list on the left. You still need to pass the `rooms` prop as an array with a single element.
194+
| Style | Syntax | Example | Output |
195+
| ----------------- | --------------- | -------------------------------------- | -------------------------------------- |
196+
| Bold | `* *` | `*This is bold text*` | **This is bold text** |
197+
| Italic | `_ _` | `_This text is italicized_` | _This text is italicized_ |
198+
| Strikethrough | `~ ~` | `~This was mistaken text~` | ~~This was mistaken text~~ |
199+
| Underline | `° °` | `°This text is underlined°` | <ins>This text is underlined</ins> |
200+
| Nested formatting | `* *` and `_ _` | `*This text is _extremely_ important*` | **This text is _extremely_ important** |
194201

195-
(10) `theme` can be used to change the chat theme. Currently, only `light` and `dark` are available.
202+
(9) `responsiveBreakpoint` can be used to collapse the rooms list on the left when then viewport size goes below the specified width.
196203

197-
(11) `styles` can be used to customize your own theme. Ex:
204+
(10) `singleRoom` can be used if you never want to show the rooms list on the left. You still need to pass the `rooms` prop as an array with a single element.
205+
206+
(11) `theme` can be used to change the chat theme. Currently, only `light` and `dark` are available.
207+
208+
(12) `styles` can be used to customize your own theme. Ex:
198209

199210
```javascript
200211
styles="{

0 commit comments

Comments
 (0)