Skip to content

sanekun/streamlit-editorjs-component

Repository files navigation

streamlit-editor-js-component

Custom component for editorjs.
Editorjs is json-based rich-text-editor.

Installation

pip install streamlit-editorjs-component

Getting started

import streamlit as st
from streamlit-editorjs-component import streamlit_editorjs

content = streamlit_editorjs(height=500)
st.write(content)
Args:  
    data (dict, optional): initial json data formatted as EditorJS. Defaults to None.  
    key (str, optional): Streamlit state key. Defaults to None.  
    height (int, optional): Component block height it the content over the height, it makes scroll. Defaults to 500.

Returns:  
    dict: dictionary content from EditorJS.

For developer

Add new plugins

Add tools to constant.js

yarn install
yarn build
streamlit run test/st_component_example.py