Skip to content

[ Docs ] Guidelines for Primitives

Zach Nugent edited this page Mar 1, 2024 · 1 revision

Writing Documentation for Primitives

If you would like to participate in writing the documentation for primitives, please follow the template below and refer to the example docs and the example for using primitives.

Example Docs: Portal

Example Using Primitives: Starter-Base

Template

  1. Use a <LinkButton target="_blank" /> for external dependencies (ex: @radix-ui/react-accordion).
  2. A short description of the primitive.
  3. Features (optional): Use <Card title="Features" /> and add an unordered list of its features.
  4. Use the ## Installation heading.
  5. Add installation steps in bold and use the <Code code={importedCode} lang="tsx" title="~/components/primitives/${component}" /> for all the related files.
  6. Use the ## Usage heading.
  7. Show an example of usage. Avoid using the <Code /> component since the reader should see the entire usage example.
  8. Use the ## Props.
  9. Write each component as an h3 heading, optionally add a short description, and add a table for all of that components props. Ex:
| Prop |       Type        |                   Note                   |
| :--: | :---------------: | :--------------------------------------: |
|      |                   |                                          |