```jsx filename="MyComponent.stories.js|jsx" renderer="common" language="js" import { ColorItem, ColorPalette } from '@storybook/blocks'; import { MyComponent } from './MyComponent'; export default { component: MyComponent, }; const theme = { colors: { primaryDark: { value: '#1C1C1C', }, primaryRegular: { value: '#363636', }, primaryLight1: { value: '#4D4D4D', }, primaryLight2: { value: '#878787', }, primaryLight3: { value: '#D1D1D1', }, primaryLight4: { value: '#EDEDED', }, }, }; // ❌ Don't use the Doc Blocks inside your stories. It will break Storybook with a cryptic error. export const Colors = { render: () => ( {Object.entries(theme.colors).map(([key, { value }]) => ( ))} ), }; ``` ```tsx filename="MyComponent.stories.ts|tsx" renderer="common" language="ts-4-9" // Replace your-framework with the name of your framework import type { Meta } from '@storybook/your-framework'; import { ColorItem, ColorPalette } from '@storybook/blocks'; import { MyComponent } from './MyComponent'; const meta = { component: MyComponent, } satisfies Meta; export default meta; type Story = StoryObj; const theme = { colors: { primaryDark: { value: '#1C1C1C', }, primaryRegular: { value: '#363636', }, primaryLight1: { value: '#4D4D4D', }, primaryLight2: { value: '#878787', }, primaryLight3: { value: '#D1D1D1', }, primaryLight4: { value: '#EDEDED', }, }, }; // ❌ Don't use the Doc Blocks inside your stories. It will break Storybook with a cryptic error. export const Colors: Story = { render: () => ( {Object.entries(theme.colors).map(([key, { value }]) => ( ))} ), }; ``` ```tsx filename="MyComponent.stories.ts|tsx" renderer="common" language="ts" // Replace your-framework with the name of your framework import type { Meta, StoryObj } from '@storybook/your-framework'; import { ColorItem, ColorPalette } from '@storybook/blocks'; import { MyComponent } from './MyComponent'; const meta: Meta = { component: MyComponent, }; export default meta; type Story = StoryObj; const theme = { colors: { primaryDark: { value: '#1C1C1C', }, primaryRegular: { value: '#363636', }, primaryLight1: { value: '#4D4D4D', }, primaryLight2: { value: '#878787', }, primaryLight3: { value: '#D1D1D1', }, primaryLight4: { value: '#EDEDED', }, }, }; // ❌ Don't use the Doc Blocks inside your stories. It will break Storybook with a cryptic error. export const Colors: Story = { render: () => ( {Object.entries(theme.colors).map(([key, { value }]) => ( ))} ), }; ```