Search code examples
storybookchakra-ui

How can I view the code of example Chakra UI components in Storybook


If you use Chakra UI alongside Storybook, it automatically populates examples of all the different Chakra components, shown in the image. But is there a way to view the code that produces these examples, as it would be helpful when making them? I tried looking in the packages but couldn't find where they are located.

Chakra UI in Storybook


Solution

  • You can find the code in their GitHub repo. For example, the Layout component is in https://github.com/chakra-ui/chakra-ui/tree/main/packages/layout