Badge

Documentation du tag

Returns a badge item. Takes a dict as parameter, with the following structure:

data_dict = {
    "label": "Label of the button item",
    "extra_classes": "(Optional) string with names of extra classes."
}

All of the keys of the dict can be passed directly as named parameters of the tag.

Relevant extra_classes:

  • village-badge--sm: small-sized badge
  • village-badge--green-menthe other color codes: change the color of the badge
  • village-badge--success (or error/info/warning/new): system badges
  • village-badge--no-icon: removes the icon on system badges

Tag name: village_badge

Usage: {% village_badge data_dict %}

Exemples

Données

{'extra_classes': '', 'label': 'Badge simple'}

Résultat

Badge simple

Données

{'extra_classes': 'village-badge--sm', 'label': 'Petit badge'}

Résultat

Petit badge

Données

{'extra_classes': 'village-badge--green-menthe', 'label': 'Badge coloré'}

Résultat

Badge coloré

Données

{'extra_classes': 'village-badge--success', 'label': 'Badge système'}

Résultat

Badge système