Icon

Icon component wrapper.

python 5 params

Preview

name
size
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

NameTypeDefault
namestr''
sizestr'md'
icon_setstr'heroicons'
custom_classstr''
**kwargs— passed to `Component.__init__`: `id=` sets `component.id`, and any other keyword is kept as state
Source & styles
FilePathNotes
moduledjust.components.components.iconSubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components.cssDefines 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.