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 component 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

  • CDN — a CDN-hosted stylesheet + bundle for quick prototyping and zero-setup trials.

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.0.tar.gz (104.5 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.0-py3-none-any.whl (141.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_cotton_ui-0.2.0.tar.gz
  • Upload date:
  • Size: 104.5 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.0.tar.gz
Algorithm Hash digest
SHA256 9de160ee97437cc1014d2ba84d6c14a5b753444f1ced2f1f6cf4e8ca1bb41d3d
MD5 f7cd59756cf111fcc8cff3b331cadfb9
BLAKE2b-256 404197b2b0cb1c7307869767e7647f624aed246f6632894cb070a5cbd58abad3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_cotton_ui-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 141.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10f5f2c8f40c3502898d65ac339b38d3983c8f4381ea9b2d4c7d0ab242d73af4
MD5 903be612c7cd61dacab903861af5142d
BLAKE2b-256 615769c008f96b07e0fbc0d9d8de5b0777d1628ae4fc35ddde65aa4d79514eab

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