Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@neocoast/react-native-pell-rich-editor
Advanced tools
React Native Rich Editor - NeoCoast's fork
A fully functional Rich Text Editor for both Android and iOS
yarn add @neocoast/react-native-pell-rich-editor
or
npm i @neocoast/react-native-pell-rich-editor
Also, follow instructions here to add the native react-native-webview
dependency.
RichEditor
The editor component. Simply place this component in your view hierarchy to receive a fully functional Rich text Editor.
RichEditor
takes the following optional props:
initialContentHTML
HTML that will be rendered in the content section on load.
editorInitializedCallback
A function that will be called when the editor has been initialized.
useContainer
A boolean value that determines if a View container is wrapped around the WebView. The default value is true. If you are using your own View to wrap this library around, set this value to false.
onKeyDown
A callback triggered on every keydown on the RichEditor
.
focusOnMount
When this prop is true
, the text editor will be focused (on the end).
RichEditor
also has methods that can be used on its ref
to set:
setContentHTML(html:string)
insertImage(url:string)
setContentFocusHandler(handler: Function)
blurContentEditor()
focusContentEditor(atEnd: bool = false)
This method registers a function that will get called whenver the cursor position changes or a change is made to the styling of the editor at the cursor's position., The callback will be called with an array of actions
that are active at the cusor position, allowing a toolbar to respond to changes.
registerToolbar(listener: Function)
<RichEditor
ref={(r) => this.richtext = r}
initialContentHTML={'Hello <b>World</b> <p>this is a new paragraph</p> <p>this is another new paragraph</p>'}
editorInitializedCallback={() => this.onEditorInitialized()}
/>
RichToolbar
This is a Component that provides a toolbar for easily controlling an editor. It is designed to be used together with a RichEditor
component.
The RichToolbar
has one required property:
getEditor()
Which must provide a function that returns a ref
to a RichEditor
component.
This is because the ref
is not created until after the first render, before which the toolbar is rendered. This means that any ref
passed directly will inevitably be passed as undefined
.
Other props supported by the RichToolbar
component are:
actions
An array
of actions
to be provided by this toolbar. The default actions are:
actions.insertImage
actions.setBold
actions.setItalic
actions.insertBulletsList
actions.insertOrderedList
actions.insertLink
onPressAddImage
Functions called when the addImage
actions are tapped.
selectedButtonStyle
iconTint
selectedIconTint
unselectedButtonStyle
These provide options for styling action buttons.
renderAction
Altenatively, you can provide a render function that will be used instead of the default, so you can fully control the tollbar design.
iconMap
RichTextToolbar
comes with default icons for the default actions it renders. To override those, or to add icons for non-default actions, provide them in a dictionary to this prop.
<RichToolbar getEditor={() => this.richtext}/>
FAQs
React Native Rich Editor - NeoCoast's fork
The npm package @neocoast/react-native-pell-rich-editor receives a total of 9 weekly downloads. As such, @neocoast/react-native-pell-rich-editor popularity was classified as not popular.
We found that @neocoast/react-native-pell-rich-editor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.