Avatar Group

Style-agnostic avatar group using CSS custom properties.

python 5 params

Preview

ALGH+1
Arguments
avatar_group(users=[{'name': 'Ada Lovelace'}, {'name': 'Grace Hopper'}, {'name': 'Alan Turing'}], max_display=2)

Usage

views.py
python
from djust import LiveView
from djust.components import AvatarGroup


class MyView(LiveView):
    template_name = "my_template.html"

    def mount(self, request, **kwargs):
        self.component = AvatarGroup(users=[{'name': 'Ada Lovelace'}, {'name': 'Grace Hopper'}, {'name': 'Alan Turing'}], max_display=2)
my_template.html
django
{{ component }}

Parameters

NameTypeDefault
usersList[Union[dict, object]] | NoneNone
max_displayint5
sizestr'md'
custom_classstr''
**kwargs— passed to `Component.__init__`: `name=` identifies the instance in the events it sends, `id=` sets `component.id`, and any other keyword is kept as state
Source & styles
FilePathNotes
moduledjust.components.components.avatar_groupSubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components-classes.cssDefines 5 of this component's classes at line 641, 642, 645, 646, 648. Override those rules, or the custom properties they read, in a stylesheet loaded after it.
cssdjust_components/components.cssDefines 5 of this component's classes at line 1589, 1590, 1593, 1594, 1597. Override those rules, or the custom properties they read, in a stylesheet loaded after it.