Skip to main content
All components should be placed in the client/src/components directory. In that directory, the components not in a subdirectory are common shared components, such as Button and Card. These are used across the application. Components specific to a page are placed in subdirectories, such as client/src/components/admin/AdminToolbar.tsx.

Making a component

To create a component, refer to the common components. For example, here is the Card component:
Props should be defined in a separate interface, with doc comments for each prop. If you are passing in children to the component, use React.ReactNode as the type. If you are passing in a Tailwind className, make sure to make it an optional string. Note that all props that are NOT optional will be required to be used otherwise an error will be thrown.

Using components

Refer to the official React docs on how to use a component if you don’t know how to.