Skeleton
Skeleton loading placeholder component.
Preview
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
| Name | Type | Required | Default |
|---|---|---|---|
| variant | str | text | |
| width | str | 100% | |
| height | str | 1rem | |
| css_prefix | str | — | |
| attrs | dict | — |
Source & styles
| File | Path | Notes |
|---|---|---|
| template | djust_theming/components/skeleton.html | Copy it to the same path in your project, or per theme under djust_theming/themes/<theme>/components/. |
| css | djust_theming/components.css | Defines 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. |
| css | djust_components/components.css | Defines 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. |
| css | djust_theming/performance.css | Defines 1 of this component's classes at line 160. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |
| css | djust_theming/scaffold.css | Defines 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>