react-native-highlightr
v0.1.24
Published
a code editor component for react native
Downloads
32
Readme
react-native-highlightr
a code editor component for react native -- this component is a wrapper of Highlightr
currently ios only
Installation
npm install react-native-highlightr
cd ios
pod install
Usage
import HighlightrView from 'react-native-highlightr'
...
<HighlightrView language={"Swift"} theme={"atom-one-dark"} value={"func helloWorld(){}"} onChangeText={someFunc}/>
Props (more formal documentation coming soon)
see highlightrjs for availabe languages and themes
- language - type: String, description: the name of the coding language to be highlighted
- theme - type: String, description: theme for syntax highlighing
- value - type: String, description: a string value for the code editor view (mirrors text input value prop usagae)
- editable - type: Boolean, description: a boolean to toggle whether the text view's text is editable (if false, keyboard is disabled)
- onChangeText - type: Function, description: a callback function that has the current string value of the text view passed in
- onPress - type: Function, description: a callback function called whenever the text view is pressed
- keyboardAppearance - type: enum ['light', 'dark'], description: sets keyboard appearance for the text view
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT