Icon
Icon component wrapper.
Preview
python
icon(name='check', size='md')Usage
views.py
python
from djust import LiveView
from djust.components import Icon
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = Icon(name='check', size='md')my_template.html
django
{{ component }}Parameters
| Name | Type | Default |
|---|---|---|
| name | str | '' |
| size | str | 'md' |
| icon_set | str | 'heroicons' |
| custom_class | str | '' |
| **kwargs | — passed to `Component.__init__`: `id=` sets `component.id`, and any other keyword is kept as state | — |
Source & styles
| File | Path | Notes |
|---|---|---|
| module | djust.components.components.icon | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 4 of this component's classes at line 1279, 1281, 1282, 1283. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |