Skeleton

Skeleton loading placeholder component.

template 0 required 5 optional 0 slots 0 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'
        self.width = '200px'
        self.height = '1rem'
my_template.html
django
{% load theme_components %}
{% theme_skeleton variant=variant width=width height=height %}

Props

NameTypeRequiredDefaultDescription
variantstrtext—
widthstr100%—
heightstr1rem—
css_prefixstr——
attrsdict——

Accessibility

No additional accessibility rules are declared for this component. Keep its required semantic elements and labels when supplying the context.

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 1028, 1033, 1037, 1041. 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 539, 540, 542. 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 1211. 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>