Skip to content
Snippets Groups Projects
Unverified Commit 3ea2530c authored by Phoomparin Mano's avatar Phoomparin Mano Committed by GitHub
Browse files

docs(sdk): add loading and error states to docs (#49246)


* document loader and error states

* document loader and error states in the docs

* revert changes to README.md

Co-authored-by: default avatarJeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: default avatarJeff Bruemmer <jeff.bruemmer@gmail.com>
parent e2036b61
No related branches found
No related tags found
No related merge requests found
......@@ -167,3 +167,16 @@ const theme = {
},
};
```
### Customizing loader and error components
You can provide your own components for loading and error states by specifying `loaderComponent` and `errorComponent` in the config.
```tsx
import { defineEmbeddingSdkConfig } from "@metabase/embedding-sdk-react";
const config = defineEmbeddingSdkConfig({
loaderComponent: () => <div>Analytics is loading...</div>,
errorComponent: ({ message }) => <div>There was an error: {message}</div>,
});
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment