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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_cotton_ui-0.2.4.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.4.tar.gz
Algorithm Hash digest
SHA256 6483aa1db663ffaec7317307d04b09c1ff6772cbe1eb86399fe61e3f66754d5d
MD5 88493d8ca492676ae56e7126706283a0
BLAKE2b-256 c69f6dd05cc2acace57afce90f6900c35866557caeba5b159050d3d8071f8670

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_cotton_ui-0.2.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8dd464a4a66d4205d6ffb769b535402a17266e0d5c9753c7862fbcef557a0e69
MD5 c6c522091cb42887406ae51ea0c97237
BLAKE2b-256 4177b8ce80c77a7198e9651939c71e240805122ec2617a538c6f6a3b40f86efb

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