dev-docs/docs/@excalidraw/excalidraw/api/props/render-props.mdx
A function returning JSX to render custom UI in the top right corner of the app.
function App() {
return (
<div style={{ height: "500px" }}>
<Excalidraw
renderTopRightUI={() => {
return (
<button
style={{
background: "#70b1ec",
border: "none",
color: "#fff",
width: "max-content",
fontWeight: "bold",
}}
onClick={() => window.alert("This is dummy top right UI")}
>
Click me
</button>
);
}}
/>
</div>
);
}
A function that can be used to render custom stats (returns JSX) in the nerd stats dialog.
For example you can use this prop to render the size of the elements in the storage as do in excalidraw.com.
function App() {
return (
<div style={{ height: "500px" }}>
<Excalidraw
renderCustomStats={() => (
<p style={{ color: "#70b1ec", fontWeight: "bold" }}>
Dummy stats will be shown here
</p>
)}
/>
</div>
);
}
Allows you to replace the renderer for embeddable elements (which renders <iframe> elements).
| Parameter | Type | Description |
|---|---|---|
element | NonDeleted<ExcalidrawEmbeddableElement> | The embeddable element to be rendered. |
appState | AppState | The current state of the UI. |