Skip to main content

Structure

Learn about the structure of components. Components in the web/components folder should be Pascal case. Every component in the project should have these five files:

FILEDESCRIPTION
_map.tsxMaps contentful data when used on a page, auto adds/formats your props, adds test data from -> "./test.data.tsx"
index.stories.tsxThis is the storybook file for component documentation and imports the test data from the test.data.tsx file
index.tsxThe main component file, modify it however you want
styles.tsxUses styled-components to define styles
test.data.tsxDefines the test data that will be viewable on localhost on the /test-components page

Example Component

An example component structure can be found in web/components/Template. You can ignore the createComponentBtn.tsx file in that folder.