Build HTML layouts in Dash with HTML
Project description
Build your Dash layouts with HTML snippets
This package allows you to craft your Dash application layouts by writing HTML instead of a cascade of Python objects.
Installation
You can install the package with pip:
pip install dash-htmlayout
Documentation
Read documentation to learn more
Introduction
It's a bit counterproductive to force users to build dashboard layouts using Python, when most component classes are translated into HTML.
Having to write code with deeply nested object instances to mimic HTML should almost be considered malpractice in Python when there is a language and a document type that addresses this exact need; HTML.
This package provides a simple class to generate layouts from a partial HTML snippet. For example, we could partially reproduce a classic layout with the following document:
<!-- Example with Bootstrap classes and some components -->
<section>
<h1 class="mb-5">Dashboard component.</h1>
<div class="row">
<div class="col-3">
<div class="form-group mb-3">
<label for="">Genres filter</label>
<dcc-dropdown id="genre-list" placeholder="Filter genres" data-multi="True"/>
</div>
<div class="form-group mb-3">
<label for="">Max results</label>
<dcc-slider id="genre-limit" data-value="1" data-min="0" data-max="10"/>
</div>
</div>
...
</div>
</section>
In Python
from dash import Dash
from dash.htmlayout import Builder
application = Dash("appname")
builder = Builder(file="myfile.html")
application.layout = builder.layout
...
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dash_htmlayout-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 081c321c7662483d1ec0f4c9d9dcef9942293d0f47586a2ec522f8534ff14389 |
|
MD5 | fac06d7b3e244d5e47e7d58a4ece8dac |
|
BLAKE2b-256 | 8d07fd3106d02bbe074745f09d40f05210ea59b31187726227bf6649732a9ced |