A Streamlit custom component that provides a free drawing canvas using Fabric.js. Supports drawing shapes, text, images, and exporting as JSON or images. Current version: 0.9.3, updated occasionally.
pip install streamlit-drawable-canvasNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic canvas that draws freehand and outputs JSON data.
Update code to use the new API: canvas_result.image_data returns a numpy array; use canvas_result.json_data for drawing JSON.
Update drawing_mode to one of the new valid modes: 'freedraw', 'line', 'rect', 'circle', 'transform', 'polygon', 'point', 'text', 'image', 'eraser'.
Remove realtime_update from st_canvas calls.
Use key parameter with st.session_state to force updates, or use 'transform' mode which updates on each mouse move.
Run `pip install streamlit-drawable-canvas` in the same environment as your Streamlit app.
Remove the realtime_update argument from the st_canvas call.
Update drawing_mode to one of: 'freedraw', 'line', 'rect', 'circle', 'transform', 'polygon', 'point', 'text', 'image', 'eraser'.