Skip to main content

UI component library for Django Cotton

Project description

Django Cotton UI

An optional kit of accessible, themeable UI components for Django Cotton, built with Tailwind CSS v4 and Alpine.js.

📖 Documentation: django-cotton.com/ui

The docs cover installation, theming and every component with live examples.

Install

pip install django-cotton-ui

Add it to INSTALLED_APPS after django_cotton:

INSTALLED_APPS = [
    # ...
    "django_cotton",
    "django_cotton_ui",
]

Then <link> the kit's precompiled stylesheet and load the Alpine bundle in your base template, no build step is required to use the components, and you re-theme by overriding the CSS-variable tokens in any stylesheet. A Tailwind v4 build is only needed if your own pages use Tailwind utility classes (the usual reason any project runs Tailwind); the kit itself never needs one. If you do run a build, set @custom-variant dark (&:where(.dark, .dark *)) so its dark mode matches the kit's (class-based). See the installation guide for the full setup.

Usage

Components use the c-ui. prefix:

<c-ui.button variant="primary">Save</c-ui.button>
<c-ui.input name="email" label="Email" placeholder="you@example.com" />

<c-ui.card>
    <h3 class="font-semibold">Title</h3>
    <p>Content goes here.</p>
</c-ui.card>

Browse the full set with live examples in the ui docs.

Requirements

  • Python ≥ 3.8 · Django ≥ 4.2 · django-cotton ≥ 2.5
  • A precompiled stylesheet ships with the package: just <link> it, no build step needed to use the components, and theming is done by overriding the CSS-variable tokens in any stylesheet. Tailwind CSS v4 is optional, only if your own pages use Tailwind utility classes.
  • Alpine.js v3

Roadmap

  • Publish and document CDN-hosted stylesheet for quick prototyping
  • Convert all docs to markdown source
  • Add a llms.txt
  • More components

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_cotton_ui-0.2.3.tar.gz (152.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_cotton_ui-0.2.3-py3-none-any.whl (190.3 kB view details)

Uploaded Python 3

File details

Details for the file django_cotton_ui-0.2.3.tar.gz.

File metadata

  • Download URL: django_cotton_ui-0.2.3.tar.gz
  • Upload date:
  • Size: 152.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.0 Linux/6.17.0-1015-azure

File hashes

Hashes for django_cotton_ui-0.2.3.tar.gz
Algorithm Hash digest
SHA256 29b0de24b036aba8caaa49fc13e9a858c785b38a28a163dc09f7dd376162e0b6
MD5 8d8f6132237c0c53af54f7d09e7f65c6
BLAKE2b-256 98e3d2def1407644a4027d88354b97c0931146ba78e7dca922679e395e9dc6a4

See more details on using hashes here.

File details

Details for the file django_cotton_ui-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: django_cotton_ui-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 190.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.0 Linux/6.17.0-1015-azure

File hashes

Hashes for django_cotton_ui-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 43a2fd31c9b639fae130024a4e336dd66b83a5aeac02f7d0e29b0768a657f773
MD5 4b9c340bdf214a0d762732ddfe71b40c
BLAKE2b-256 9c0ee4f12a5e3e114379c98cb8cb7331043fea5da1901da7285dcb89febe9254

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page