{"categories":[{"label":"Dynamic Content","url":"https://skillfed.io/packages/category/internet-www-http-dynamic-content/2"}],"enrichment":{"capability":"Django Cotton adds component-based UI composition to Django templates, letting you define reusable HTML components with slots, attributes, and template expressions without leaving Django's native template system.","skillfed_tags":["django-templates","ui-components","template-composition"],"use_cases":["Build a reusable button component with icon slots and URL attributes to avoid duplicating button markup across templates.","Create form input components that accept arbitrary HTML attributes via the {{ attrs }} variable to reduce boilerplate.","Compose a bio-card component that accepts context variables (:user=\"user\") to render profiles without template duplication.","Define HTMX-enabled components that can be rendered directly from views and reused across multiple pages.","Organize complex layouts by nesting components with named slots to separate concerns between parent and child templates."],"what_it_does":"Django Cotton extends Django's template language to support component-based UI design. Instead of writing template fragments scattered across files, you define reusable components in a templates/cotton folder and invoke them with HTML-like syntax (<c-my-component />). Components support slots for content injection, named slots for multi-region layouts, attributes both static and dynamic, boolean flags, and Python data types. The package compiles components to native Django template tags at load time with built-in caching and automatic invalidation on file changes.\n\nIt solves the friction of composing modular UIs in Django without requiring a separate templating engine. Components encapsulate layout, styling, and interaction logic in one file, work well alongside Tailwind and Alpine.js, and integrate with HTMX for dynamic behavior. The syntax is HTML-native, so code editors provide highlighting, formatting, and autoclosing out of the box.","worth_installing":"Yes. Django Cotton is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a real pain point in Django template composition. It's marked Production/Stable and sits in the top 15000 packages by download volume. Install it if you want component-based UI design without leaving Django's template system."},"id":"django-cotton","links":{"html":"https://skillfed.io/packages/django-cotton","md":"https://skillfed.io/packages/django-cotton.md","pypi":"https://pypi.org/project/django-cotton/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-06-01","license_spdx":null,"license_treatment":"permissive","name":"django-cotton","python_support":"supports_current","summary":"Enabling Modern UI Composition in Django."},"popularity":{"monthly_downloads":419317,"position":6800,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"2.7.2"}
