Component Library

Documentation of all components used in the Swollr app. This is a reference for development and debugging.

🤖 Auto-Generated Documentation: This library automatically discovers all 81 components during build time. New components are automatically included with zero maintenance.

⚠️ Experimental Feature: This component library is a work in progress. Many components will crash or display errors because they expect specific props, context, or data that isn't provided in this isolated environment.

Known Limitations:

  • Components using hooks like useWorkout or useUserStats may fail
  • Components expecting exercise data, workout data, or other props will show errors
  • Form components need mock handlers that aren't fully implemented
  • Some components require React Context that isn't available here

Future Work: Components need to be refactored to support default values or this library needs to provide comprehensive sample data for all component types.

🔍

Select a Component

Choose a component from the dropdown above to see a live preview

81 components available across 12 categories

🤖 How This Works (Zero Maintenance)

✅ Adding New Components

Zero manual work required! Just create a new component file anywhere in src/components/ and it will automatically appear here on the next build.

1. Create: src/components/MyNewComponent.js
2. Run: npm run build
3. Visit: /components
4. ✨ Your component appears automatically!

🔄 Auto-Categorization

Components are automatically categorized based on their folder location:

calculators/ → calculators
exercise/ → exercise
workout/ → workout
layout/ → layout
forms/ → forms
shared/ → shared
home/ → home
muscle/ → muscle

⚙️ Build Process

This library is automatically updated during every build:

npm run build

npm run generate:components

scripts/generate-component-list.js

Scans src/ for React components

Updates src/data/component-registry.js

This page shows latest components ✨

🛠️ Customization (Optional)

To modify how components are discovered or categorized, edit:

scripts/generate-component-list.js - Discovery script
src/data/component-registry.js - Generated data (auto-updated)

📋 All Components

calculators9

common2

components9

exercise20

filters10

history1

home3

layout4

muscle1

settings1

shared1

workout20

📊 Summary

81
Total Components
12
Categories
81
Available
0
Selected