storybook-addon | Develop themable components with Emotion/Styled Components | Addon library
kandi X-RAY | storybook-addon Summary
kandi X-RAY | storybook-addon Summary
Storybook addon for Styled Components, Emotion, Material-UI and any other theming solution. Allows to develop themed components in isolation.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Resolve relative path to webpack config
- Generate a packager
storybook-addon Key Features
storybook-addon Examples and Code Snippets
Community Discussions
Trending Discussions on storybook-addon
QUESTION
I'm importing a css file into a typescript module, but the import resolves to a string instead of an object. Can anyone tell me why I don't get an object??
Example ...ANSWER
Answered 2021-Oct-18 at 10:52I think you have mistake in your Webpack
config. You have nested rules
property, instead you should have use
:
QUESTION
I currently have Gatsby installed on version 4, but I wanted to "downgrade" it to version 3, and all dependencies to be compatible with version 3.
Is there any method to "downgrade" everything to the most up-to-date V3 version?
My package.json
...ANSWER
Answered 2021-Nov-23 at 14:16There's no magic command to downgrade automatically Gatsby version and all related dependencies. Basically, you need uninstall and reinstall Gatsby to your desired version:
If you need to reset your gatsby-cli
version:
QUESTION
I upgraded my project from NextJS 10 to NextJS 12. Everything is working except for Storybook, which has no styles now.
I am using styled-jsx
library to generate embedded css
, using it as:
ANSWER
Answered 2021-Nov-13 at 13:23Newer styled-jsx
required the following:
QUESTION
Storybook only loads stories when I make changes.
So when I yarn start
my storybook it shows up with:
ANSWER
Answered 2021-Nov-12 at 00:55"chart.js": "^3.6.0",
Chart JS, when it has an error, instead of throwing an error message, sometimes it just silently breaks.
I guess storybook had no handle for this odd case and loaded nothing without an error in the console. Which is fine because storybook was not the one with the error, this seems like Chart's fault.
QUESTION
I know close to zero about Webpack, Babel, Loaders and how they interact.
Problem descriptionI develop an Angular component library that I recently migrated to Angular 12. I am currently setting up Storybook for documentation. I wanted to use the Storybook plugin "@etchteam/storybook-addon-css-variables-theme" to switch between different CSS stylesheets.
Through the documentation of this plugin I found out about the webpack loader syntax, especially for lazy-loaded stylesheets, i.e.
...ANSWER
Answered 2021-Oct-18 at 11:07My issue has been solved by @Akxe: import css file into es6 returns string instead of object
Using import * as test from '...'
solved my issue.
QUESTION
I have some components that use Redirect (from react-router-dom) in certain scenarios. It seems that Storybook does not like this even though I wrap my story with a router decorator. Does anyone know how to make Storybook work with Redirect?
The closest thing I have been to achieve this is to use @storybook/addon-links but no success so far. I have created a repository, the components I am looking for are related to Landing.stories.jsx and Login.stories.jsx
https://github.com/javierguzman/storybook-addon-links
Thank you in advance and regards
...ANSWER
Answered 2021-Oct-12 at 16:22The solution I found is to use "Story Links Addon", npm package name "@storybook/addon-links".
Once it is installed, I wrap my story with a memory router, specifying route and path according to the Redirect you want to make. In this way, once Redirect is called, AutoLinkTo gets rendered as well, which is the one switching stories:
QUESTION
I want to customize themes in Vuetify using Storybook 6 and I am using @socheatsok78/storybook-addon-vuetify
package https://storybook.js.org/addons/@socheatsok78/storybook-addon-vuetify
I did exactly what documentation says but theme is still not working at all. I want to configure vuetify with custom properties and with my own color palette.
preview.js
ANSWER
Answered 2021-Sep-20 at 10:21Ok I fixed the theme, you can find an tutorial how to do this and with all working code down below. I found a great explanation here:
https://morphatic.com/2020/09/30/configuring-storybook-6-for-vue-2-vuetify-2-3/
preview.html
QUESTION
I am setting up a new project from scratch. The project is in typescript using storybooks and jest for testing. I am encountering an issue while running toMatchSnapshot()
assertion on a react component.
This is my index.test.tsx
:
ANSWER
Answered 2021-Aug-18 at 15:30The fix is very simple.I had to set the "jsx" key to "react" rather than "preserve" in tsconfig.json. Found the answer here: https://github.com/vercel/next.js/issues/8663
QUESTION
ANSWER
Answered 2021-May-18 at 11:17I solved this problem by removing withPerformance from decorators.
Edit: Here is the solution:
QUESTION
I am trying to setup Storybook from scratch for a new project. I am hitting a wall and finding no useful information online around a babel/webpack issue that appears during build.
Note that I am able to correctly run Storybook locally, this issue only happens during build time.
The project has no webpack.config.js file as none came via the following commands.
How to diagnose further and fix the build issues?
Initial Set-up
- React Boilerplate: https://react-boilerplate.github.io/react-boilerplate-cra-template/
- Storybook out of the box set-up: https://storybook.js.org/docs/react/get-started/install
No issue running storybook locally
...npm run storybook --debug-webpack
ANSWER
Answered 2020-Dec-18 at 19:37By default the react template uses a webpack config which is in a different directory. Replacing the build directory app by stories fixed it.
internals\webpack\webpack.base.babel.js
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install storybook-addon
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page