You can manage npm dependencies, and add a custom error message for Storybook, on the Storybook & React page in your documentation settings.
Add a custom Storybook error message
Add an error message that will be shown to your viewers any time an error occurs in a Storybook block in your documentation.
To do so:
- Type your desired error message into the empty field in the Storybook error message section.
- Publish your documentation to apply this change.
Custom or predefined package.json
You can include custom or predefined package.json definition for all React code blocks in your documentation in the Package.json dependencies for React code blocks section.
To do so:
- Select a template to use if you want to use an existing library as a dependency, or fill in the package.json with your own custom content.
- If you select a template and make edits, you can click Reset to default to start with the default template again.
- Publish your documentation to apply the changes. The dependencies will now be used for all of your React code blocks.