Skip to main content

daisy-cotton-ext

Tests Coverage Python 3.12 | 3.13 Django 5.2 | 6.0 | 6.1 License: MIT

Extended components and page blocks for django-cotton and daisyUI.

Built on django-cotton and daisyUI. daisy-cotton holds one Cotton component for each daisyUI component. This package holds what is built on top of those, and it comes in two kinds:

  • Extended components: single components that go further than their daisyUI counterpart, such as a card with more structure than card gives you.
  • Page blocks: whole regions of a public-facing page, such as a hero, ready to drop in.

The blocks came first, and they are what is built so far.

Component libraries in this space cover the application: navigation, forms, tables, dialogs. They stop at the pages that sit in front of it — the landing page, the pricing page, the sign-up pitch. Those get assembled by hand out of raw utility classes, in every project, every time.

Blocks are configured through attributes and take their colours from whatever daisyUI theme the project already runs, so a page built from them re-themes with the rest of the site.

Contents

Status

Version 0.0.1. Two families are built, heroes and backgrounds, and nothing here is stable. Block names, attributes and the set of classes the stylesheet emits all change between minor versions, and the CHANGELOG is how a project finds out.

Scope & philosophy

What this is. A presentation-only library of extended components and page blocks. Templates, a stylesheet, and the small amount of JavaScript some blocks need. Blocks are configured through attributes and themed by whatever daisyUI theme the project runs, so a page built from them never pins a literal colour into the markup.

What this deliberately is not.

  • Not an application. No models, no views, no forms, no URLs, no migrations. A block's content comes from the template author, never from a queryset.
  • Not a CSS framework. No daisyUI plugin, no theme layer, no preflight. Those come from the project.
  • Not the base components. A component that maps one-to-one onto a daisyUI component belongs in daisy-cotton. What lives here adds to one or combines several.
  • Not application chrome. Navigation, forms, tables and CRUD pages take their content from the application, and they are somebody else's job.
  • Not a fixed catalogue. The set of blocks grows as new ones are designed. There is no taxonomy to fill in.
  • Not page templates. Blocks only. You pick the ones you want and assemble the page yourself. There is no one-tag landing page.

Tie-breaks. When two of these pull against each other: theme-driven beats hard-coded, a block that composes existing daisyUI markup beats one that invents its own, and leaving a job to the project beats doing it here.

The directions the package works toward are in GOALS.md, and the order they are being built in is in the roadmap.

Requirements

  • Python 3.12+
  • Django 5.2, 6.0 or 6.1
  • django-cotton 2.6+
  • daisyUI 5, loaded by the project

daisyUI is a hard requirement and this package does not ship it. Any project already running daisyUI satisfies it, whether through its own Tailwind build or through a package that provides one, such as django-mvp.

Install

pip install daisy-cotton-ext

Add it to INSTALLED_APPS:

INSTALLED_APPS = [
    ...,
    "django_cotton",
    "daisy_cotton_ext",
]

Then load its stylesheet alongside the one carrying daisyUI:

<link rel="stylesheet" href="{% static 'css/your-daisyui-build.css' %}">
<link rel="stylesheet" href="{% static 'css/daisy-cotton-ext.css' %}">

The two stylesheets do different jobs. Yours carries daisyUI, its themes and Tailwind's preflight. This one carries the plain Tailwind utilities the blocks need and which your build has no way to know about, because it scans your source and these templates live in site-packages. Some rules will appear in both, which costs bytes and nothing else.

Blocks are then available as Cotton tags:

<c-hero.centred title="Ship it on Friday">
  ...
</c-hero.centred>

Blocks

Heroes

Three arrangements and one inline helper. A different arrangement is a different tag rather than an option on one component, so moving a page from one to another is a one-word change.

Tag What it is
<c-hero.centred> One column, centred. The opener for a page whose words are the product.
<c-hero.split> Copy beside a visual, stacking to one column below lg.
<c-hero.showcase> Centred copy over a wide, lifted product panel.
<c-hero.highlight> An inline span that fills the words it wraps with one of daisyUI's colour pairs. Headings only.

The three arrangements take the same attributes:

Attribute Default What it does
eyebrow — A short line above the heading: a category, a release name
title — The heading
lead — The supporting sentence under it
level 1 Heading level, so a page carrying two heroes keeps a real heading order
invert off Light copy, for a dark background
size md How much vertical room the block takes: sm, md, lg, and screen on the centred arrangement
class — Extra classes on the outer section. A plain surface colour goes here: bg-base-200
reverse off Split only. Mirrors the two columns at lg and above

And the same slots. Anything you pass that is not listed above is forwarded to the section element, so id, data- attributes and the rest reach the markup untouched.

Slot What goes in it
background A background block, rendered into a layer behind the copy
announcement Above the eyebrow. A pill linking to the latest release, usually
actions The button row. Write real anchor or button markup, so it can post, submit or carry anything
footnote Under the actions. A trust line, a rating, a row of logos
media Split and showcase only. The picture beside or below the copy

Backgrounds

A background is not part of a layout, so it is not part of a block. Each one is its own block that goes in another block's background slot, which means any background composes with any layout.

Tag What it draws Attributes
<c-background.glow> Two heavily blurred discs of the theme's colours from, to, intensity
<c-background.gradient> A wash between two palette colours from, via, to, direction, opacity
<c-background.grid> A faint ruled grid size, intensity, flat
<c-background.image> A picture, dimmed by the theme's neutral src, dim, position

Two things to know about them. A background belongs in a background slot and nowhere else, because it positions itself against that slot's wrapper rather than filling its parent in normal flow. And a dark background needs invert on the block, since a background cannot reach up to recolour its sibling. Each block's page says whether it wants one.

<c-hero.centred title="Ship the page, not the CSS"
                lead="Blocks for the pages in front of your app."
                invert>
  <c-slot name="background">
    <c-background.image src="{% static 'img/desk.jpg' %}" dim="strong" />
  </c-slot>
  <c-slot name="actions">
    <a class="btn btn-primary btn-lg" href="{% url 'signup' %}">Get started</a>
  </c-slot>
</c-hero.centred>

Every attribute, its accepted values and its default are listed on each block's own page in the example project, built from the annotations in the block's template. Run it with python manage.py runserver from a checkout.

Contributing

Development setup, building the stylesheet and the rules changes are held to are in CONTRIBUTING.md.

Changelog

Every release is recorded in CHANGELOG.md.

License

MIT

Metadata

Release files for daisy-cotton-ext 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for daisy-cotton-ext 0.1.0
File Size Uploaded
daisy_cotton_ext-0.1.0.tar.gz 16.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for daisy-cotton-ext 0.1.0
File Interpreter ABI Platform
daisy_cotton_ext-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.0 kB

Release files / daisy_cotton_ext-0.1.0.tar.gz

Download URL daisy_cotton_ext-0.1.0.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dcf63d5d2f35e2f1a4b8dac38cc0db9fdc4be42cd4ccc5ba80bde95230712a49
BLAKE2b-256 checksum
How to use checksums
18956f81f5fb364c5783b6d4080e3b72d0acbe3462332cde831ea196787f52bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / daisy_cotton_ext-0.1.0-py3-none-any.whl

Download URL daisy_cotton_ext-0.1.0-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95fc0da9109c306759374ce2b9b93eda71dd2a332b1261dce9aaae201567804f
BLAKE2b-256 checksum
How to use checksums
e33e9e50d16d451e81de5ed46631908a2d57057bfee834a60325be5afa79f651
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page