Py.Cafe

namakshenas/

dash-mantine-grid-example

Dash Mantine Grid Example

DocsPricing
  • app.py
  • dash_mantine_components-0.15.0-py2.py3-none-any.whl
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import dash_mantine_components as dmc
from dash import Dash, html, _dash_renderer

_dash_renderer._set_react_version("18.2.0")


app = Dash()

style = {
    "border": f"1px solid {dmc.DEFAULT_THEME['colors']['indigo'][4]}",
    "textAlign": "center",
}

app.layout = dmc.MantineProvider(
    [
        dmc.SimpleGrid(
            type="container",
            cols={"base": 1, "300px": 2, "500px": 5},
            spacing={"base": 10, "300px": "xl"},
            children=[
                html.Div("1", style=style),
                html.Div("2", style=style),
                html.Div("3", style=style),
                html.Div("4", style=style),
                html.Div("5", style=style),
            ],
        )
    ],
)


if __name__ == "__main__":
    app.run(debug=True)