Search

Search documentation

Documentation Guidelines

How to write and generate documentation for Evolphin UI components.

This guide explains how to create documentation for components in Evolphin UI. You can either use LLM-based automation or write docs manually using our template.


Quick Start


When to Use Each Approach

SituationRecommended Approach
New component with many variantsπŸ€– LLM
Bulk documentation (5+ components)πŸ€– LLM
Quick prop update✏️ Manual
Simple component (< 3 props)✏️ Manual
Need very specific wording✏️ Manual
First draft, then refineπŸ€– LLM β†’ ✏️ Manual

LLM-Based Approach

Use AI to generate comprehensive documentation automatically.

Files Location

Project Structure
llm.txt
component-docs-prompt.mdLLM prompt template
component-template.mdxManual template
README.mdUsage instructions

How It Works

Copy the Prompt

Open llm.txt/component-docs-prompt.md and copy the entire contents.

Set the Component Name

Replace {COMPONENT_NAME} at the bottom of the prompt with your component:

Component to document: `button`

Provide Component Source

Give the LLM the component source code from:

registry/default/ui/{component-name}.tsx

Generate & Review

  • Run the prompt with your preferred LLM
  • Review the generated documentation
  • Make any necessary refinements

Save the Documentation

Save the final MDX to:

content/docs/components/{component-name}.mdx

Example Prompt Usage

# Copy from llm.txt/component-docs-prompt.md

[... prompt content ...]

Component to document: `dialog`

---

Here is the component source:

[Paste contents of registry/default/ui/dialog.tsx]

The LLM will analyze the component and generate complete documentation with all variants, examples, and API reference.


Manual Approach

For simple components or quick updates, use the manual template.

How It Works

Copy the Template

Copy llm.txt/component-template.mdx

Replace Placeholders

Replace all {placeholders} with actual values:

  • {ComponentName} β†’ Button
  • {component-name} β†’ button
  • {description} β†’ Your description

Add Examples

Create a <ComponentPreview> for each:

  • Default state
  • Each variant
  • Each size
  • With icons
  • Special states (loading, disabled)

Fill API Reference

Document all props in the table:

| Prop      | Type                       | Default     | Description  |
| --------- | -------------------------- | ----------- | ------------ |
| `variant` | `"default" \| "secondary"` | `"default"` | Visual style |

Save

Save to content/docs/components/{component-name}.mdx


Documentation Structure

Every component doc should have these sections:

Required Sections

SectionPurpose
Title + DescriptionFrontmatter with SEO-friendly text
InstallationCLI commands with package manager tabs
UsageImport statement + basic example
ExamplesComponentPreview for each variant
API ReferenceProps table with types and defaults

Optional Sections

SectionWhen to Include
AccessibilityKeyboard/screen reader behavior
SubcomponentsIf component has parts (Dialog.Trigger, etc.)
CompositionComplex usage patterns

Quality Checklist

Before submitting documentation:

  • Title matches component name
  • Description is concise (one line)
  • Installation has all 3 package managers
  • Import path uses @/components/ui/
  • Every variant has a working preview
  • API table includes ALL props
  • Default values are documented
  • Types are accurate
  • No broken imports

ComponentPreview Usage

Always use <ComponentPreview> for interactive examples:

<ComponentPreview code={`<Button variant="secondary">Click</Button>`}>
  <Button variant="secondary">Click</Button>
</ComponentPreview>

The code prop must match what's rendered inside. Keep them in sync!

Multi-line Code

For complex examples:

<ComponentPreview
  code={`<Button>\n  <Mail className="mr-2 h-4 w-4" />\n  Email\n</Button>`}
>
  <Button>
    <Mail className="mr-2 h-4 w-4" />
    Email
  </Button>
</ComponentPreview>

File Naming

TypeConventionExample
Component docs{kebab-case}.mdxdate-picker.mdx
Guide pages{kebab-case}.mdxgetting-started.mdx
Meta filesmeta.jsonmeta.json

Resources

On this page