-
Notifications
You must be signed in to change notification settings - Fork 6
Contributing
Lawren edited this page Dec 13, 2019
·
4 revisions
Please use $ npm run commit to commit your changes. This will use commitizen to properly format your commit messaging. Templates are provided for pull requests, as well.
Component organization can be a little nebulous, but here are some guidelines to help you get started.
-
Most components should have the following files:
index.tsxtypes.tsstyles.scssstories.tsxtest.tsx
-
Components may have a child
/components/directory. This can be done to bucket other components within a category or namespace (i.e.Input) or simply to house child-components or fragments of the larger component. Components nested this way should be added as members to the more generic parent component if they are likely to be reused.└── /Card # the <Card /> component ├── /components ├── /CardBody # the <Card.Body /> component ├── /CardHeader # the <Card.Header /> component ├── /CardTitle # the <Card.Title /> component ├── index.tsx ├── stories.tsx ├── styles.scss └── types.tsThe above example could be used like so:
import Card from '@brewkit/components/Card'; <Card>Some content.</Card> // or <Card> <Card.Header> <Card.Title>Card Header</Card.Title> </Card.Header> <Card.Body>Some other content.</Card.Body> </Card>