-
-
Notifications
You must be signed in to change notification settings - Fork 180
[ Docs ] Guidelines for UI Components
Zach Nugent edited this page Mar 1, 2024
·
1 revision
If you would like to participate in writing the documentation for UI components, please follow the template below and refer to the example docs and the example for using primitives.
Example Docs: Accordion
Example Using UI Components: Starter-Base
- Use a
<LinkButton target="_blank" />
for documentation of the primitive it uses (if applies) and another one for the demo. Find the components at https://rnr-showcase.vercel.app/components and apply that component's url to theLinkButton
- A short description of the component.
- Use the
## Installation
heading. - If it uses a primitive, use the following component and replace the name and url to the appropriate primitive:
<Aside type="tip" title="Depends on a primitive">
Before copy/pasting, add the <a href="/primitives/${primitive}" className='text-white font-bold'>${primitive} primitive</a> to your project.
</Aside>
- Add installation steps in bold and use the
<Code code={importedCode} lang="tsx" title="~/components/ui/${component}" />
for all the related files. - Use the
## Usage
heading. - Show an example of usage. Avoid using the
<Code />
component since the reader should see the entire usage example. - Use the
## Props
. - 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 |
| :--: | :---------------: | :--------------------------------------: |
| | | |