There's two ways to add a live demo in MDX files. We call them inline and external demos.
Both inline and external demos need to export a function that can be consumed by React.createElement
. Even this will do: export default () => "Hey"
For more complex code, you can use "external" demos:
For simpler cases, you can use "inline" demos:
Go to next pages to see various examples.