1.0.10 • Published 2 years ago

slateless v1.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

A React Minimal Rich Text Editor based on Slate.

Slate but Less. Demo

Dealing with Slate can be a very tedious task for most of us. So here is a plug and play Editor and a Renderer.

The idea is simple:
- input a state
- outputs a result (save it somewhere)
- render where you need it

Usage

Import components:
import { SlateEditor, SlateContent } from "slateless";
Create a State and OnChange handler:
const [value, setValueChange] = useState("");
const onValueChange = (val: string) => {
    setValueChange(val);
};
Bind the state and handler into the Editor:
<SlateEditor value={value} onChange={onValueChange} />
Bind the state into the Content Renderer:
It's completely up to you when you want to re-render this component.
Let's assume you want to render this everytime you are editing the editor.
code:

<SlateContent value={value} key={Date.now()} />
Customizing Toolbars:
<SlateEditor
    value={value}
    onChange={onValueChange}
    toolbar={[
        "heading-1",
        "heading-2",
        "heading-3",
        "heading-4",
        "heading-5",
        "heading-6",
        "bold",
        "italic",
        "underline",
        "strikethrough",
        "link",
        "numbered-list",
        "bulleted-list",
        "left",
        "center",
        "right",
        "image"
    ]}
/>
1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago