Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:
yarn add @codecademy/gamut-kit @emotion/react @emotion/styled
{ "peerDependencies": { "@codecademy/gamut": "*", "@codecademy/gamut-icons": "*", "@codecademy/gamut-illustrations": "*", "@codecademy/gamut-patterns": "*", "@codecademy/gamut-styles": "*", "@codecademy/gamut-tests": "*", "@codecademy/variance": "*" } }
GamutProvider
and give it the theme you would like to use for your app.import React from 'react'; import { render } from 'react-dom'; import { GamutProvider, theme } from '@codecademy/gamut-styles'; import { App } from './App'; const rootElement = document.getElementById('root'); render( <GamutProvider> <App /> </GamutProvider>, rootElement );
GamutProvider handles a few critical tasks that need to happen in order for components to work.
Note: For react frameworks like Next and Gatsby this will be slightly different (see the SSR section for further steps for each framework). Your entry points for each framework will be:
_app.tsx
gatsby-ssr.js
gatsby-browser.js
and use wrapRootElement
in each.// theme.d.ts import '@emotion/react'; // Import the appropriate theme shape `PlatformTheme` or `CoreTheme` import { CoreTheme } from '@codecademy/gamut-styles'; declare module '@emotion/react' { export interface Theme extends CoreTheme {} }
For more information this declaration please checkout the official emotion documentation!
import { Background } from '@codecademy/gamut-styles'; import { Text } from '@codecademy/gamut'; export const App = () => ( <Background bg="beige"> <Text as="h1">Hello World!</Text> </Background> );