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 143 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

143 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

common4

components41

exercise30

filters11

history4

home4

layout5

musclegroup1

settings1

shared5

workout28

๐Ÿ“Š Summary

143
Total Components
12
Categories
143
Available
0
Selected