You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-3Lines changed: 25 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,10 +167,13 @@ Actually we did not implement 'Toolbar buttons and menus' and 'Image Uploading P
167
167
To see an example of how to implement more advanced feature of this editor please check this [Link](https://github.com/imnapo/react-native-cn-richtext-editor/blob/master/expo-demo/App.js).
168
168
169
169
Also be noticed that this example is writen with expo and required 'react-native-popup-menu' package.
170
-
## Props
170
+
171
+
## API
171
172
172
173
### CNRichTextEditor
173
174
175
+
#### Props
176
+
174
177
| Name | Description | Required |
175
178
| ------ | ----------- | ---- |
176
179
| onSelectedTagChanged | this event triggers when selected tag of editor is changed. | No |
@@ -180,9 +183,21 @@ Also be noticed that this example is writen with expo and required 'react-native
180
183
| value | an array object which keeps value of the editor | Yes |
181
184
| styleList | an object consist of styles name and values (use getDefaultStyles function) | Yes |
182
185
| ImageComponent | a React component (class or functional) which will be used to render images. Will be passed `style` and `source` props. | No |
186
+
| style | Styles applied to the outermost component. | No |
187
+
| contentContainerStyle | Styles applied to the scrollview content. | No |
188
+
189
+
#### Instance methods
190
+
191
+
| Name | Params | Description |
192
+
| ------ | ---- | ----------- |
193
+
| applyToolbar |`toolType`| Apply the given transformation to selected text. |
194
+
| insertImage |`uri, id?, height?, width?`| Insert the provided image where cursor is positionned. |
195
+
| focus || Focus to the last `TextInput`|
183
196
184
197
### CNToolbar
185
198
199
+
#### Props
200
+
186
201
| Name | Required | Description |
187
202
| ------ | ------ | ----------- |
188
203
| selectedTag | Yes | selected tag of the editor |
@@ -200,9 +215,15 @@ Also be noticed that this example is writen with expo and required 'react-native
200
215
| image | No | a component which renders as image button |
201
216
| highlight | No | a component which renders as highlight button |
202
217
| foreColor | No | a component which renders as foreColor button |
203
-
218
+
| style | No | style applied to container |
219
+
| color | No | default color passed to icon |
220
+
| backgroundColor | No | default background color passed to icon |
221
+
| selectedColor | No | color applied when icon is selected |
222
+
| selectedBackgroundColor | No | background color applied when icon is selected |
223
+
| iconContainerStyle | No | a style prop assigned to icon container |
204
224
205
225
### Functions
226
+
206
227
| Name | Param | Returns | Description |
207
228
| ------ | ------ | ------ |----------- |
208
229
| getInitialObject | - | javascript object | create a initial value for the editor. |
@@ -211,6 +232,7 @@ Also be noticed that this example is writen with expo and required 'react-native
211
232
| getDefaultStyles | - | javascript object | creates required styles for the editor. |
0 commit comments