+
+ convertToExcalidrawElements(elements:{" "}
+
+ ExcalidrawElementSkeleton
+
+ )
+
+
+**_How to use_**
+
+```js
+import { convertToExcalidrawElements } from "@excalidraw/excalidraw";
+```
+
+This function converts the Excalidraw Element Skeleton to excalidraw elements which could be then rendered on the canvas. Hence calling this function is necessary before passing it to APIs like [`initialData`](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/initialdata), [`updateScene`](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/ref#updatescene) if you are using the Skeleton API
+
+## Supported Features
+
+### Rectangle, Ellipse, and Diamond
+
+To create these shapes you need to pass its `type` and `x` and `y` coordinates for position. The rest of the attributes are optional_.
+
+For the Skeleton API to work, `convertToExcalidrawElements` needs to be called before passing it to Excalidraw Component via initialData, updateScene or any such API.
+
+```jsx live
+function App() {
+ const elements = convertToExcalidrawElements([
+ {
+ type: "rectangle",
+ x: 100,
+ y: 250,
+ },
+ {
+ type: "ellipse",
+ x: 250,
+ y: 250,
+ },
+ {
+ type: "diamond",
+ x: 380,
+ y: 250,
+ },
+ ]);
+ return (
+ custom Sidebar Content
-
- (element: NonDeleted<ExcalidrawEmbeddableElement>, appState: AppState) => JSX.Element | null
+ (element: NonDeleted<ExcalidrawEmbeddableElement>, appState:{" "}
+
+ AppState
+
+ ) => JSX.Element | null
Allows you to replace the renderer for embeddable elements (which renders `