{% trans "Stack-agnostic playground for your Cotton components. Every component is annotated, copy-and-pasteable, and themable through your design tokens — bring your own stack (Tailwind, HTMX, Alpine, your own bundle…) and start shipping." %}
{{ categories|total_components }}
{% trans "Components" %}
{{ subcategories|component_count }}
{{ cat_name }}
{% blocktranslate with path=onboarding.cotton_dir_abs %}The gallery is looking for components in {{ path }}, but that folder doesn't exist yet.{% endblocktranslate %}
{% trans "Two ways to fix it:" %}
{{ subfolder }}/ inside one of your TEMPLATES['DIRS'] entries (or any installed app's templates/ folder when APP_DIRS is on) and drop a component file in it.{% endblocktranslate %}COTTON_DIR = '...' in your settings.py. The default is '{{ subfolder }}' — set it to whatever name your components folder uses.{% endblocktranslate %}
{% blocktranslate with path=onboarding.cotton_dir_abs %}Drop your first Cotton component into {{ path }} and the gallery will pick it up automatically — no restart needed.{% endblocktranslate %}
{% trans "Example layout:" %}
{{ onboarding.cotton_subfolder }}/
├── atoms/
│ ├── ui/
│ │ └── button.html <c-atoms.ui.button />
│ └── form/
│ └── input.html <c-atoms.form.input />
└── molecules/
└── form/
└── form-field.html <c-molecules.form.form-field />
{% trans "Optional: enable language switching" %}
{% blocktranslate %}The gallery is translated into English, Spanish, Basque, and French — but the language dropdown only appears when your project mounts Django's i18n URLs and LocaleMiddleware. Add both in your urls.py and settings.py to enable it.{% endblocktranslate %}