Skip to main content

A Django Cotton Component Library of Heroicons

Project description

cotton-heroicons

A Django Cotton Component Library of Heroicons

Usage

To use the icons in your templates, simply add the component tag with the icon name as the tag name. The default variant is 'outline', but you can specify a different variant using the 'variant' attribute.

Any additional HTML attributes (e.g. class, id) are passed directly to the <svg> element.

Each variant has a default size that matches the Heroicons recommendations:

  • outline / solid: 1.5rem (24px)
  • mini: 1.25rem (20px)
  • micro: 1rem (16px)

You can override the default size by passing a style attribute.

<!-- The default variant is 'outline' -->
<c-heroicon.cloud />

<!-- Specify the variant with the 'variant' attribute -->
<c-heroicon.shopping-bag variant="mini" />

<!-- Add additional classes -->
<c-heroicon.square-3-stack-3d class="text-violet-700" />

<!-- Override the default size -->
<c-heroicon.eye style="width: 0.75rem; height: 0.75rem;" />

Outline variant options

The outline variant exposes stroke_width, stroke_linecap, and stroke_linejoin attributes:

<c-heroicon.cloud stroke_width="2" />

Installation

pip install cotton-heroicons

Update Django settings:

INSTALLED_APPS = [
    ...
    'django_cotton',
    'cotton_heroicons',
    ...
]

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

cotton_heroicons-0.2.0.tar.gz (153.8 kB view details)

Uploaded Source

Built Distribution

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

cotton_heroicons-0.2.0-py3-none-any.whl (387.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cotton_heroicons-0.2.0.tar.gz
  • Upload date:
  • Size: 153.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for cotton_heroicons-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a220da6692dd717116c3907fbbff56e597f7116466d9e4671a3982abd8488201
MD5 181d6d96ae54c551e959d5b506753498
BLAKE2b-256 9e7f381cf4734b39a36f959dacabb9cadd17d608b59a8ae658d48d0deb3acd5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cotton_heroicons-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b022b12dcb253f1c8274dc969f9655637e8ccd3b25d1c92d07a56f1b8d2c574b
MD5 f6d46f3e1d58dc36918022251b10efcb
BLAKE2b-256 e0df34094402aaa8a7d4b60741a6b19f758ffd60077bb88718ef4bb454dbb5f3

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