Back to Storybook

Nextjs Styling Css Modules

docs/_snippets/nextjs-styling-css-modules.md

10.3.6826 B
Original Source
js
// This import will work in Storybook
import styles from './Button.module.css';
// Sass/Scss modules are also supported
// import styles from './Button.module.scss'
// import styles from './Button.module.sass'

export function Button() {
  return (
    <button type="button" className={styles.error}>
      Destroy
    </button>
  );
}
ts
// This import will work in Storybook
import styles from './Button.module.css';
// Sass/Scss modules are also supported
// import styles from './Button.module.scss'
// import styles from './Button.module.sass'

export function Button() {
  return (
    <button type="button" className={styles.error}>
      Destroy
    </button>
  );
}