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.2.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.2-py3-none-any.whl (190.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_cotton_ui-0.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 f01cee039abd5c2334e91702be393dd5066a7f7e9fd8f82ab49729f8e750b933
MD5 d3f9626052db769e3203fb2983c3b9bd
BLAKE2b-256 09a46c0128042ab024994558a9d21c9b6003dae3a8e5bf19a2755502c0691667

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_cotton_ui-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 190.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f0585b9641ef65d5ad6bea3925505396f70e7ac6937d183fc2a99c4c0b002ab2
MD5 00123ba2f4a3ff3695f60f8eacd8611e
BLAKE2b-256 c8f06ff6022e8b64b8d811b63adc97a8ed15375315dda8c7d5db6ef151bed510

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