# wrabit/django-cotton

Enabling Modern UI Composition in Django

Repository: https://github.com/wrabit/django-cotton
Canonical: https://ross.abutalabs.com/products/django-cotton
Homepage: https://django-cotton.com
Language: Python
License: MIT
License Family: permissive
Topics: django, components, ui
Last push: 2026-07-23T10:07:16+00:00

## Health v2 (maintenance only)
Score: 84/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 94, release rhythm 86, longevity 58
- inputs: {"age_days": 816, "days_push": 41, "days_rel": 93, "gap_med": 3, "n_releases_24m": 50}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1163, forks 61 (observed 2026-08-28T04:03:49.689840+00:00)

## What it is
Django Cotton is a Python library that brings component-based UI composition to Django templates, letting developers define reusable components in single template files and use them with HTML-like tags or native Django template tags. It compiles to native Django template tags with caching, supports slots, attributes, and vars, and pairs well with Tailwind CSS, Alpine.js, and HTMX.

## Use cases
- build reusable UI components in Django templates
- replace repetitive {% include %} snippets with components
- create consistent form input components across a Django app
- compose page layouts with slots and variants
- build reusable HTMX components rendered from views
- use React-style components without leaving Django templates

## When to choose
- you use Django's template engine and want modern component-based UI composition
- you want reusable components without Jinja, a build step, or a JS frontend framework
- you pair Django with Tailwind CSS, Alpine.js, or HTMX and want encapsulated UI files

## When to avoid
- your project uses Jinja2 instead of Django's template language
- you need a full client-side component framework like React or Vue
- you only need simple one-off template includes

## Facets
- artifact type: library
- maturity: active
- function: ui-components, templating, frontend-framework
- domain: web-development, frontend, developer-tools
- platform: python
- tags: django, components, slots, htmx, tailwind, alpinejs, template-tags, web-server

## Member repositories
- wrabit/django-cotton (main) score 84

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:49.689840+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:31:35.505361+00:00, confidence not recorded.
  - readme: https://github.com/wrabit/django-cotton (fetched 2026-08-28T04:03:49.689840+00:00, sha 2f383770a983)
  - homepage: https://django-cotton.com (fetched 2026-08-29T12:36:05.939298+00:00, sha bf9647ca4512)
  - site_page: https://django-cotton.com/docs/quickstart (fetched 2026-08-29T12:36:05.958702+00:00, sha 6bd4c3b33270)
  - site_page: https://django-cotton.com/docs/components (fetched 2026-08-29T12:36:05.970931+00:00, sha 3667aa3c31b0)
  - site_page: https://django-cotton.com/docs/fundamentals (fetched 2026-08-29T12:36:05.973423+00:00, sha c09123c0db90)
  - site_page: https://django-cotton.com/docs/configuration (fetched 2026-08-29T12:36:05.975321+00:00, sha ee2f1ad05907)
  - site_page: https://django-cotton.com/docs/thinking-in-components (fetched 2026-08-29T12:36:05.976975+00:00, sha ff7bb43bc9cd)
  - site_page: https://django-cotton.com/docs/form-fields (fetched 2026-08-29T12:36:05.978500+00:00, sha d43a2f47f39a)
  - site_page: https://django-cotton.com/docs/alpine-js (fetched 2026-08-29T12:36:05.980027+00:00, sha d19b5d1a8e16)
  - site_page: https://django-cotton.com/docs/layouts (fetched 2026-08-29T12:36:05.981520+00:00, sha fe061443f585)
- Data as of 2026-08-30T08:39:29.467469+00:00.
