1.0.10 • Published 1 year ago

slateless v1.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year 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

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago