https://github.com/clauderic/slate-android
Plugin to bring Android support to Slate
https://github.com/clauderic/slate-android
Last synced: 10 months ago
JSON representation
Plugin to bring Android support to Slate
- Host: GitHub
- URL: https://github.com/clauderic/slate-android
- Owner: clauderic
- License: mit
- Created: 2021-02-09T21:05:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-10T21:43:50.000Z (almost 5 years ago)
- Last Synced: 2025-02-06T13:32:03.584Z (11 months ago)
- Language: TypeScript
- Size: 231 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Slate Android
This repository is a work in progress. It builds on previous approaches to bring Android support to [Slate](https://www.slatejs.org/).
## Usage
```jsx
import React, {useMemo} from 'react';
import {createEditor, Node} from 'slate';
import {Editable, Slate, withReact} from 'slate-react';
import {useAndroid} from 'slate-android';
export function Editor() {
const [value, setValue] = useState([{children: [{text: 'Hello, world!'}]}]);
const editor = useMemo(() => withReact(createEditor()), []);
const {attributes} = useAndroid(editor);
return (
);
}
```
## Commands
### Watch for changes
```bash
npm start # or yarn start
```
This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.
Then run either Storybook or the example playground:
### Storybook
Run inside another terminal:
```bash
yarn storybook
```