Skeleton

Skeleton loading placeholder component.

template 0 required5 optional0 slots0 a11y rules

Preview

variant
width
height
python
skeleton(variant='text', width='200px', height='1rem')

Usage

views.py
python
from djust import LiveView


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

    def mount(self, request, **kwargs):
        self.variant = 'text'
my_template.html
django
{% load theme_components %}
{% theme_skeleton variant=variant width='200px' height='1rem' %}

Props

NameTypeRequiredDefault
variantstrtext
widthstr100%
heightstr1rem
css_prefixstr
attrsdict
Source & styles
FilePathNotes
templatedjust_theming/components/skeleton.htmlCopy it to the same path in your project, or per theme under djust_theming/themes/<theme>/components/.
cssdjust_theming/components.cssDefines 4 of this component's classes at line 959, 964, 968, 972. Override those rules, or the custom properties they read, in a stylesheet loaded after it.
cssdjust_components/components.cssDefines 3 of this component's classes at line 516, 517, 519. Override those rules, or the custom properties they read, in a stylesheet loaded after it.
cssdjust_theming/performance.cssDefines 1 of this component's classes at line 160. Override those rules, or the custom properties they read, in a stylesheet loaded after it.
cssdjust_theming/scaffold.cssDefines 1 of this component's classes at line 1209. Override those rules, or the custom properties they read, in a stylesheet loaded after it.
CSS variables
--muted --radius
Template source — skeleton.html
django
<div class="{{ css_prefix }}skeleton {{ css_prefix }}skeleton-{{ variant }} {% if attrs.class %}{{ attrs.class }}{% endif %}"
     aria-hidden="true"
     style="width: {{ width }}; height: {{ height }}"
     {% if attrs.id %}id="{{ attrs.id }}"{% endif %}>
</div>