LLMs.txt Format Reference
The LLMs.txt format is a standardized way to document components for AI systems. It's designed to be both human-readable and machine-parseable, making it ideal for inclusion in AI prompts and system contexts.
What is LLMs.txt?
LLMs.txt is a plain-text format that describes components in a way that's easy for AI systems to understand and use. It combines structured sections with plain English descriptions.
Benefits
- Human Readable – Easy to include in prompts
- Machine Parseable – AI can reliably extract information
- Complete – Includes all information AI needs
- Stable – Format doesn't change unexpectedly
- No Dependencies – Just plain text, works everywhere
Format Structure
Document Header
Component Section
Each component has this structure:
Complete Example: Button Component
Here's a real example of how the Button component appears in LLMs.txt:
Format Sections Explained
Component Header
ComponentName: Exact export name from the packageCategory: One of: action, input, layout, navigation, feedback, information, dataStatus: Component maturity level
Description
Import Section
Standard import statement for the component.
Props Section
Format Rules:
- List each prop on its own line
- Include the type (
string,boolean,function, etc.) - Describe what the prop does
- For enums, list each valid value with description
- Note defaults
- Mark as required or optional
Variants Section
Document each variant and its purpose. Explain semantic meaning.
Examples Section
What to Include:
- Basic usage
- All major variants
- Common prop combinations
- Loading/disabled states
- Responsive examples
- Icon/label examples
Accessibility Section
Document accessibility features and requirements.
Composition Section
Explain how this component relates to others.
Design Tokens Section
List semantic design tokens for each variant.
Complete File Template
Generating LLMs.txt
Command Line
Generate the LLMs.txt file for your project:
Programmatically
In Your Documentation
Include LLMs.txt in your documentation:
Using LLMs.txt with Claude
In System Prompt
Include a reference to LLMs.txt in Claude's system instructions:
In User Prompt
Reference specific components when asking Claude:
With MCP Server
Use the MCP server to get real-time LLMs.txt:
Best Practices
For Component Authors
- Keep Examples Simple – Show common patterns, not edge cases
- Be Descriptive – Explain the 'why', not just the 'what'
- Include All Props – Don't omit optional props
- Document Accessibility – Make it clear what a11y features exist
- Show Variants – Include all variants with examples
- Update Regularly – Keep LLMs.txt in sync with code
For AI Prompts
- Include Full LLMs.txt – Don't summarize, include the complete text
- Reference Specific Components – "Use the Button component with variant='primary'"
- Show Examples – Quote the examples from LLMs.txt
- Be Explicit About Props – List the specific props you want used
- Request Type Safety – Ask for TypeScript with types from LLMs.txt
Format Conventions
- Use
##for component names - Use
###for major sections (Props, Examples, etc.) - Use
####for subsections if needed - Use backticks for code:
propName,variant="primary" - Use bold for emphasis: important concept
- Use ````jsx` for code blocks
- Keep line length reasonable (max 80 characters for readability)
Common Components in LLMs.txt
Button
Primary, secondary, outline, ghost variants Size: sm, md, lg Disabled, loading states
Input
Type: text, email, password, number, etc. Error states Icon support Disabled state
Select
Options as children or array Single or multiple selection Searchable variant Grouped options
Flex/Grid
Responsive column/row configuration Alignment and justification Gap spacing Auto-fit/auto-fill
Form/FormField
Composition with Input, Select, etc. Error display Validation feedback
Modal/Dialog
Header, body, footer sections Backdrop dismiss Focus trapping Keyboard support (Escape to close)
Card
Header, body, footer sections Composable container Shadow and border styling
Validation
Checking LLMs.txt Format
Validate your LLMs.txt:
Requirements
- All exported components documented
- All props listed
- Examples provided
- Accessibility section included
- Proper formatting with markdown
- No broken imports or references
Version History
The LLMs.txt format evolves over time:
Check the version in your LLMs.txt:
Troubleshooting
Claude doesn't use the right component
Cause: LLMs.txt examples aren't clear enough Fix: Add more detailed examples showing common patterns
Generated code has wrong props
Cause: Props not clearly documented in LLMs.txt Fix: List all props with descriptions and defaults
Components missing from LLMs.txt
Cause: Component not exported from package Fix: Export component and regenerate LLMs.txt
Formatting issues in prompt
Cause: LLMs.txt formatting may be unclear Fix: Use cleaner formatting, clearly delineate sections
Next Steps
- Generate Your LLMs.txt →
npx ui-lab llms > components.txt - Use With Claude → Include in system prompts
- Set Up MCP → Use MCP server for dynamic access
- View Full Registry → Component Registry Reference
LLMs.txt: Reliable component documentation for AI systems.