This is an example of a React library using storybook-addon-code-editor.
Check out the story files:
You can write standalone source files (contents for the editor) if you don't want to use an inline string.
These are imported using Vite's ?raw loader.