dash-startup-loading-plugin 1.0.4__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. dash_startup_loading_plugin-2.0.0/MANIFEST.in +1 -0
  2. dash_startup_loading_plugin-2.0.0/PKG-INFO +262 -0
  3. dash_startup_loading_plugin-2.0.0/README.md +237 -0
  4. dash_startup_loading_plugin-2.0.0/pyproject.toml +55 -0
  5. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/__init__.py +17 -0
  6. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/plugin.py +400 -0
  7. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/py.typed +0 -0
  8. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/accordion-loader.js +22 -0
  9. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/analyzing-image.js +11 -0
  10. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/arc.js +17 -0
  11. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/bars.js +24 -0
  12. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/bobbing-dots.js +11 -0
  13. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/bouncing-dots.js +24 -0
  14. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/classic.js +21 -0
  15. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/clock-ring.js +21 -0
  16. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/comet-spinner.js +79 -0
  17. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/concentric-ring.js +21 -0
  18. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/conveyor-loop.js +21 -0
  19. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/dash-ring.js +11 -0
  20. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/diamond.js +25 -0
  21. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/dots-ring.js +34 -0
  22. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/dots.js +22 -0
  23. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/dual-arc.js +17 -0
  24. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/fade-arc.js +17 -0
  25. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/infinity-square-snake.js +46 -0
  26. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/infinity-track.js +46 -0
  27. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/infinity.js +17 -0
  28. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/morphing-infinity.js +10 -0
  29. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/orbit-ring.js +21 -0
  30. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/pulsating-dots.js +11 -0
  31. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/pulse-dot.js +24 -0
  32. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/pulse.js +24 -0
  33. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/quarter-ring.js +21 -0
  34. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/ring.js +17 -0
  35. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/ripple.js +11 -0
  36. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/satellite-ring.js +21 -0
  37. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/skeleton.js +17 -0
  38. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/spiral.js +11 -0
  39. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/spokes.js +17 -0
  40. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/square-accordion.js +37 -0
  41. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/square-grid.js +30 -0
  42. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/square-snake.js +30 -0
  43. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/swirling.js +39 -0
  44. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/symmetric-wave.js +135 -0
  45. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/terminal.js +22 -0
  46. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/text-blink.js +22 -0
  47. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/text-dots.js +22 -0
  48. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/text-shimmer-wave.js +11 -0
  49. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/text-shimmer.js +11 -0
  50. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/triple-dot-spinner.js +21 -0
  51. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/twin-orbit.js +17 -0
  52. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/typing.js +24 -0
  53. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/wandering-eyes.js +68 -0
  54. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/loading-ui/wave.js +22 -0
  55. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin/resources/startup-loading.js +35 -0
  56. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin.egg-info/PKG-INFO +262 -0
  57. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin.egg-info/SOURCES.txt +61 -0
  58. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin.egg-info/entry_points.txt +2 -0
  59. dash_startup_loading_plugin-2.0.0/src/dash_startup_loading_plugin.egg-info/requires.txt +2 -0
  60. dash_startup_loading_plugin-1.0.4/MANIFEST.in +0 -2
  61. dash_startup_loading_plugin-1.0.4/PKG-INFO +0 -303
  62. dash_startup_loading_plugin-1.0.4/README.md +0 -289
  63. dash_startup_loading_plugin-1.0.4/README.zh-CN.md +0 -274
  64. dash_startup_loading_plugin-1.0.4/pyproject.toml +0 -50
  65. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/README.md +0 -289
  66. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/README.zh-CN.md +0 -274
  67. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/__init__.py +0 -29
  68. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/examples/__init__.py +0 -5
  69. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/examples/__main__.py +0 -5
  70. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/examples/antd.py +0 -109
  71. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/examples/basic.py +0 -49
  72. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/examples/cli.py +0 -89
  73. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/examples/fac.py +0 -110
  74. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/examples/mantine.py +0 -79
  75. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/examples/shared.py +0 -33
  76. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/plugin.py +0 -296
  77. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/resources/loading.css +0 -64
  78. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/resources/loading.js +0 -177
  79. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin/resources/theme.js +0 -102
  80. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin.egg-info/PKG-INFO +0 -303
  81. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin.egg-info/SOURCES.txt +0 -29
  82. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin.egg-info/entry_points.txt +0 -5
  83. dash_startup_loading_plugin-1.0.4/src/dash_startup_loading_plugin.egg-info/requires.txt +0 -1
  84. dash_startup_loading_plugin-1.0.4/tests/test_documentation.py +0 -75
  85. dash_startup_loading_plugin-1.0.4/tests/test_examples.py +0 -150
  86. dash_startup_loading_plugin-1.0.4/tests/test_plugin.py +0 -270
  87. {dash_startup_loading_plugin-1.0.4 → dash_startup_loading_plugin-2.0.0}/LICENSE +0 -0
  88. {dash_startup_loading_plugin-1.0.4 → dash_startup_loading_plugin-2.0.0}/setup.cfg +0 -0
  89. {dash_startup_loading_plugin-1.0.4 → dash_startup_loading_plugin-2.0.0}/src/dash_startup_loading_plugin.egg-info/dependency_links.txt +0 -0
  90. {dash_startup_loading_plugin-1.0.4 → dash_startup_loading_plugin-2.0.0}/src/dash_startup_loading_plugin.egg-info/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ prune tests
@@ -0,0 +1,262 @@
1
+ Metadata-Version: 2.4
2
+ Name: dash-startup-loading-plugin
3
+ Version: 2.0.0
4
+ Summary: A configurable full-screen startup loading overlay for Dash apps, packaged as a Dash Hooks plugin.
5
+ Author-email: Ethan Zhang <ethan.zhang2016@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/c0debeez/dash-startup-loading-plugin
8
+ Project-URL: Bug Reports, https://github.com/c0debeez/dash-startup-loading-plugin/issues
9
+ Project-URL: Source, https://github.com/c0debeez/dash-startup-loading-plugin
10
+ Keywords: dash,plotly,loading,plugin
11
+ Classifier: Framework :: Dash
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: dash>=3.0.3
23
+ Requires-Dist: typing-extensions>=4.11
24
+ Dynamic: license-file
25
+
26
+ # dash-startup-loading-plugin
27
+
28
+ [English](https://github.com/C0deBeez/dash-startup-loading-plugin/blob/master/README.md) |
29
+ [简体中文](https://github.com/C0deBeez/dash-startup-loading-plugin/blob/master/README.zh-CN.md)
30
+
31
+ An installable [Dash Hooks plugin](https://dash.plotly.com/dash-plugins-using-hooks)
32
+ that replaces Dash's initial loading presentation with a configurable
33
+ full-screen overlay.
34
+
35
+ The plugin injects its CSS and JavaScript into Dash's normal index document
36
+ before React mounts. Applications do not need to copy assets or replace
37
+ `index_string`, and Dash's built-in `<div class="_dash-loading">` remains in the
38
+ document.
39
+
40
+ ## Requirements
41
+
42
+ - Python 3.9 or later
43
+ - Dash 3.0.3 or later
44
+
45
+ ## Installation
46
+
47
+ ```bash
48
+ pip install "dash-startup-loading-plugin>=2.0.0"
49
+ ```
50
+
51
+ Dash discovers the plugin through its `dash_hooks` entry point. Installing the
52
+ package enables the default loading overlay without an explicit import.
53
+
54
+ The default background colors work with native Dash and Dash Ant Design.
55
+
56
+ ## Quick start
57
+
58
+ The plugin is discovered automatically, so a native Dash app needs no
59
+ plugin-specific code:
60
+
61
+ ```python
62
+ from dash import Dash, html
63
+
64
+ app = Dash(__name__)
65
+ app.layout = html.Main(
66
+ [
67
+ html.H1("My Dash app"),
68
+ html.P("The overlay closes after this layout is ready."),
69
+ ]
70
+ )
71
+
72
+ if __name__ == "__main__":
73
+ app.run(debug=True)
74
+ ```
75
+
76
+ The example above uses Dash's native components from `dash.html`. You can also
77
+ use the plugin with `dash-antd-components`:
78
+
79
+ ```bash
80
+ pip install dash-ant-design
81
+ ```
82
+
83
+ ```bash
84
+ uv add dash-ant-design
85
+ ```
86
+
87
+ ```python
88
+ import dash_antd_components as dac
89
+ from dash import Dash
90
+
91
+ app = Dash(__name__)
92
+ app.layout = dac.Space(
93
+ [
94
+ dac.Title("My Dash Ant Design app", level=2),
95
+ dac.Button("Continue", type="primary"),
96
+ dac.Input(placeholder="Search"),
97
+ ],
98
+ orientation="vertical",
99
+ size="middle",
100
+ )
101
+
102
+ if __name__ == "__main__":
103
+ app.run(debug=True)
104
+ ```
105
+
106
+ When the `dash-antd-components` bundle is present, the plugin automatically
107
+ uses Ant Design's four-dot loader unless `loader` is explicitly configured.
108
+ Native Dash apps use the Loading UI `ring` loader by default.
109
+
110
+ ### Theme behavior
111
+
112
+ Theme initialization belongs to the application. Set `dark`/`light` on the
113
+ root HTML element before Dash mounts, for example in `index_string`; the
114
+ plugin's CSS follows `html.dark`. This avoids a theme flash without making the
115
+ plugin own application preferences or asynchronous theme callbacks.
116
+ Use `prefers-color-scheme` in that head script when the application follows the
117
+ operating system preference.
118
+
119
+ ## Dash Ant Design
120
+
121
+ Dash Ant Design is optional. The same `setup()` function configures native Dash
122
+ and Dash Ant Design applications. When its component bundle is present and
123
+ `loader` was not explicitly configured, the plugin uses Ant Design's four-dot
124
+ loader and `colorPrimary` defaults. Other component libraries use Loading UI's
125
+ `ring` loader by default. Explicit loader and color options always take
126
+ precedence:
127
+
128
+ ```bash
129
+ pip install dash-ant-design
130
+ ```
131
+
132
+ ```bash
133
+ uv add dash-ant-design
134
+ ```
135
+
136
+ ```python
137
+ from dash_startup_loading_plugin import setup
138
+
139
+ setup(loader="antd")
140
+ ```
141
+
142
+ ## Dismissal behavior
143
+
144
+ By default, the plugin preserves its original behavior: it observes Dash's
145
+ standard `#react-entry-point` and closes the overlay after Dash's
146
+ `._dash-loading` element disappears. Theme initialization and application
147
+ specific callback/layout settling belong in the application's `index_string`
148
+ and callbacks.
149
+
150
+ ## Configuration
151
+
152
+ `setup(**changes)` updates the process-wide immutable
153
+ `StartupLoadingConfig`.
154
+
155
+ | Option | Default | Description |
156
+ | --- | ---: | --- |
157
+ | `enabled` | `True` | Enable index injection. |
158
+ | `aria_label` | `"Loading"` | Accessible status label. |
159
+ | `z_index` | `9999` | Overlay stacking order. |
160
+ | `loader_color` | `#1677ff` | Loader color in light mode. |
161
+ | `loader_dark_color` | `#1668dc` | Loader color in dark mode. |
162
+ | `loader_text_color` | `rgba(0,0,0,0.88)` | Text color for `text-*` Loading UI loaders in light mode. |
163
+ | `loader_dark_text_color` | `rgba(255,255,255,0.85)` | Text color for `text-*` Loading UI loaders in dark mode. |
164
+ | `loader` | `"default"` | Loading UI's `ring` animation. |
165
+ | `loader_text` | `"Loading"` | Text rendered by `text-*` Loading UI loaders. |
166
+ | `loader_size` | `64` | Target loader width and height. Loading UI uses its `ring` default of 4rem (64px); the `antd` loader uses Ant Design Spin's medium visual size of 20px. Other Loading UI loaders scale proportionally from their bundled default geometry. `None` uses the 64px baseline. |
167
+ | `loader_stroke_width` | `2` | Loading UI border and SVG stroke width, generated from its 2px default at the 64px ring baseline. |
168
+ | `custom_loader_html` | `None` | Trusted HTML replacing the default spinner. |
169
+
170
+ `custom_loader_html` is inserted verbatim and must never contain untrusted
171
+ user input.
172
+
173
+ The default loader uses Loading UI's `ring` animation. To use Ant Design's
174
+ four-dot loader, configure it explicitly:
175
+
176
+ ```python
177
+ setup(loader="antd")
178
+ ```
179
+
180
+ The overlay background follows the application's `html.dark` class and `--layout-bg` CSS variable, with `#f5f5f5` and `#111825` fallbacks. The plugin does not inspect ConfigProvider tokens. Explicit color options always take precedence. Use `loader_size`, `loader_color`, `loader_dark_color`, `loader_text_color`, and `loader_dark_text_color` to match a customized theme. Use `loader_text` to replace the default text in `text-*` loaders:
181
+
182
+ ```python
183
+ setup(loader="text-shimmer", loader_text="Preparing dashboard")
184
+ ```
185
+
186
+ ## Loader gallery
187
+
188
+ The effective default depends on the component bundle:
189
+
190
+ | Application | Default loader | Notes |
191
+ | --- | --- | --- |
192
+ | Native Dash components | `ring` | Loading UI renderer. |
193
+ | `dash-antd-components` | `antd` | Ant Design's four-dot spinner. |
194
+ | Any app with an explicit `setup(loader=...)` | The selected loader | Explicit configuration always wins. |
195
+
196
+ All Loading UI loaders are bundled separately and loaded only when selected.
197
+ The preview images below link to the official interactive demos. Open a preview
198
+ to see its live animation and source details. The `text-*` loaders accept
199
+ custom text through `loader_text`; `loader_color`, `loader_dark_color`,
200
+ `loader_size`, and `loader_stroke_width` apply where supported.
201
+
202
+ | Preview | Preview | Preview |
203
+ | --- | --- | --- |
204
+ | [![accordion-loader](https://loading-ui.com/api/og/components/accordion-loader/image.png)](https://loading-ui.com/docs/components/accordion-loader)<br>`accordion-loader` | [![analyzing-image](https://loading-ui.com/api/og/components/analyzing-image/image.png)](https://loading-ui.com/docs/components/analyzing-image)<br>`analyzing-image` | [![arc](https://loading-ui.com/api/og/components/arc/image.png)](https://loading-ui.com/docs/components/arc)<br>`arc` |
205
+ | [![bars](https://loading-ui.com/api/og/components/bars/image.png)](https://loading-ui.com/docs/components/bars)<br>`bars` | [![bobbing-dots](https://loading-ui.com/api/og/components/bobbing-dots/image.png)](https://loading-ui.com/docs/components/bobbing-dots)<br>`bobbing-dots` | [![bouncing-dots](https://loading-ui.com/api/og/components/bouncing-dots/image.png)](https://loading-ui.com/docs/components/bouncing-dots)<br>`bouncing-dots` |
206
+ | [![classic](https://loading-ui.com/api/og/components/classic/image.png)](https://loading-ui.com/docs/components/classic)<br>`classic` | [![clock-ring](https://loading-ui.com/api/og/components/clock-ring/image.png)](https://loading-ui.com/docs/components/clock-ring)<br>`clock-ring` | [![comet-spinner](https://loading-ui.com/api/og/components/comet-spinner/image.png)](https://loading-ui.com/docs/components/comet-spinner)<br>`comet-spinner` |
207
+ | [![concentric-ring](https://loading-ui.com/api/og/components/concentric-ring/image.png)](https://loading-ui.com/docs/components/concentric-ring)<br>`concentric-ring` | [![conveyor-loop](https://loading-ui.com/api/og/components/conveyor-loop/image.png)](https://loading-ui.com/docs/components/conveyor-loop)<br>`conveyor-loop` | [![dash-ring](https://loading-ui.com/api/og/components/dash-ring/image.png)](https://loading-ui.com/docs/components/dash-ring)<br>`dash-ring` |
208
+ | [![diamond](https://loading-ui.com/api/og/components/diamond/image.png)](https://loading-ui.com/docs/components/diamond)<br>`diamond` | [![dots](https://loading-ui.com/api/og/components/dots/image.png)](https://loading-ui.com/docs/components/dots)<br>`dots` | [![dots-ring](https://loading-ui.com/api/og/components/dots-ring/image.png)](https://loading-ui.com/docs/components/dots-ring)<br>`dots-ring` |
209
+ | [![dual-arc](https://loading-ui.com/api/og/components/dual-arc/image.png)](https://loading-ui.com/docs/components/dual-arc)<br>`dual-arc` | [![fade-arc](https://loading-ui.com/api/og/components/fade-arc/image.png)](https://loading-ui.com/docs/components/fade-arc)<br>`fade-arc` | [![infinity](https://loading-ui.com/api/og/components/infinity/image.png)](https://loading-ui.com/docs/components/infinity)<br>`infinity` |
210
+ | [![infinity-square-snake](https://loading-ui.com/api/og/components/infinity-square-snake/image.png)](https://loading-ui.com/docs/components/infinity-square-snake)<br>`infinity-square-snake` | [![infinity-track](https://loading-ui.com/api/og/components/infinity-track/image.png)](https://loading-ui.com/docs/components/infinity-track)<br>`infinity-track` | [![morphing-infinity](https://loading-ui.com/api/og/components/morphing-infinity/image.png)](https://loading-ui.com/docs/components/morphing-infinity)<br>`morphing-infinity` |
211
+ | [![orbit-ring](https://loading-ui.com/api/og/components/orbit-ring/image.png)](https://loading-ui.com/docs/components/orbit-ring)<br>`orbit-ring` | [![pulsating-dots](https://loading-ui.com/api/og/components/pulsating-dots/image.png)](https://loading-ui.com/docs/components/pulsating-dots)<br>`pulsating-dots` | [![pulse](https://loading-ui.com/api/og/components/pulse/image.png)](https://loading-ui.com/docs/components/pulse)<br>`pulse` |
212
+ | [![pulse-dot](https://loading-ui.com/api/og/components/pulse-dot/image.png)](https://loading-ui.com/docs/components/pulse-dot)<br>`pulse-dot` | [![quarter-ring](https://loading-ui.com/api/og/components/quarter-ring/image.png)](https://loading-ui.com/docs/components/quarter-ring)<br>`quarter-ring` | [![ring](https://loading-ui.com/api/og/components/ring/image.png)](https://loading-ui.com/docs/components/ring)<br>`ring` |
213
+ | [![ripple](https://loading-ui.com/api/og/components/ripple/image.png)](https://loading-ui.com/docs/components/ripple)<br>`ripple` | [![satellite-ring](https://loading-ui.com/api/og/components/satellite-ring/image.png)](https://loading-ui.com/docs/components/satellite-ring)<br>`satellite-ring` | [![skeleton](https://loading-ui.com/api/og/components/skeleton/image.png)](https://loading-ui.com/docs/components/skeleton)<br>`skeleton` |
214
+ | [![spiral](https://loading-ui.com/api/og/components/spiral/image.png)](https://loading-ui.com/docs/components/spiral)<br>`spiral` | [![spokes](https://loading-ui.com/api/og/components/spokes/image.png)](https://loading-ui.com/docs/components/spokes)<br>`spokes` | [![square-accordion](https://loading-ui.com/api/og/components/square-accordion/image.png)](https://loading-ui.com/docs/components/square-accordion)<br>`square-accordion` |
215
+ | [![square-grid](https://loading-ui.com/api/og/components/square-grid/image.png)](https://loading-ui.com/docs/components/square-grid)<br>`square-grid` | [![square-snake](https://loading-ui.com/api/og/components/square-snake/image.png)](https://loading-ui.com/docs/components/square-snake)<br>`square-snake` | [![swirling](https://loading-ui.com/api/og/components/swirling/image.png)](https://loading-ui.com/docs/components/swirling)<br>`swirling` |
216
+ | [![symmetric-wave](https://loading-ui.com/api/og/components/symmetric-wave/image.png)](https://loading-ui.com/docs/components/symmetric-wave)<br>`symmetric-wave` | [![terminal](https://loading-ui.com/api/og/components/terminal/image.png)](https://loading-ui.com/docs/components/terminal)<br>`terminal` | [![text-blink](https://loading-ui.com/api/og/components/text-blink/image.png)](https://loading-ui.com/docs/components/text-blink)<br>`text-blink` |
217
+ | [![text-dots](https://loading-ui.com/api/og/components/text-dots/image.png)](https://loading-ui.com/docs/components/text-dots)<br>`text-dots` | [![text-shimmer](https://loading-ui.com/api/og/components/text-shimmer/image.png)](https://loading-ui.com/docs/components/text-shimmer)<br>`text-shimmer` | [![text-shimmer-wave](https://loading-ui.com/api/og/components/text-shimmer-wave/image.png)](https://loading-ui.com/docs/components/text-shimmer-wave)<br>`text-shimmer-wave` |
218
+ | [![triple-dot-spinner](https://loading-ui.com/api/og/components/triple-dot-spinner/image.png)](https://loading-ui.com/docs/components/triple-dot-spinner)<br>`triple-dot-spinner` | [![twin-orbit](https://loading-ui.com/api/og/components/twin-orbit/image.png)](https://loading-ui.com/docs/components/twin-orbit)<br>`twin-orbit` | [![typing](https://loading-ui.com/api/og/components/typing/image.png)](https://loading-ui.com/docs/components/typing)<br>`typing` |
219
+ | [![wandering-eyes](https://loading-ui.com/api/og/components/wandering-eyes/image.png)](https://loading-ui.com/docs/components/wandering-eyes)<br>`wandering-eyes` | [![wave](https://loading-ui.com/api/og/components/wave/image.png)](https://loading-ui.com/docs/components/wave)<br>`wave` | [Default: ring](https://loading-ui.com/docs/components/ring)<br>`default` |
220
+ | [Ant Design Spin](https://ant.design/components/spin)<br>`antd` | | |
221
+
222
+ The bundled [Loading UI](https://loading-ui.com/) collection supports all 47 loader names in the current upstream catalog:
223
+
224
+ ```text
225
+ accordion-loader, analyzing-image, arc, bars, bobbing-dots, bouncing-dots, classic, clock-ring, comet-spinner, concentric-ring, conveyor-loop, dash-ring, diamond, dots, dots-ring, dual-arc, fade-arc, infinity, infinity-square-snake, infinity-track, morphing-infinity, orbit-ring, pulsating-dots, pulse, pulse-dot, quarter-ring, ring, ripple, satellite-ring, skeleton, spiral, spokes, square-accordion, square-grid, square-snake, swirling, symmetric-wave, terminal, text-blink, text-dots, text-shimmer, text-shimmer-wave, triple-dot-spinner, twin-orbit, typing, wandering-eyes, wave
226
+ ```
227
+
228
+ For example:
229
+
230
+ ```python
231
+ setup(loader="spiral", loader_color="#e91e63", loader_dark_color="#ff80ab")
232
+ ```
233
+
234
+ The default loader, `ring`, and other Loading UI loaders use a bundled, isolated renderer loaded before Dash starts. Each loader ships as its own bundle, and the index only references the selected one at `<requests_pathname_prefix>_dash-startup-loading/<loader>.js`. That keeps the HTML document small and lets the browser cache the renderer, so the choice of loader does not grow the first-screen payload. No other indicator is shown while that renderer starts. Loading UI loaders sit in a centered 4:3 region that uses full width below 640px, half width from 640px, one-third from 768px, and one-quarter from 1024px. Each loader keeps the geometry from its official demo: square icons use their documented `size-*`, rectangular loaders keep their documented aspect ratio, and character-grid loaders derive intrinsic `ch`/`em` dimensions from their default props. Text loaders fit their text.
235
+
236
+ ## Python API
237
+
238
+ ```python
239
+ from dash_startup_loading_plugin import (
240
+ StartupLoadingConfig,
241
+ setup,
242
+ get_config,
243
+ reset_config,
244
+ )
245
+ ```
246
+
247
+ ## Notes
248
+
249
+ - Dash's hook and plugin configuration is process-wide. Use one configuration
250
+ per process.
251
+ - Readiness gates apply only to startup. Later callbacks do not recreate the overlay.
252
+ - The overlay markup and its small startup runtime are inlined, so strict Content
253
+ Security Policy deployments must allow the injected style and script. The
254
+ Loading UI renderer is served from a plugin route instead of being inlined.
255
+ - The overlay is only for initial application startup. Use `dcc.Loading` or
256
+ another callback-specific pattern for later callback execution.
257
+
258
+ ## License
259
+
260
+ This project is distributed under the MIT License.
261
+
262
+ MIT
@@ -0,0 +1,237 @@
1
+ # dash-startup-loading-plugin
2
+
3
+ [English](https://github.com/C0deBeez/dash-startup-loading-plugin/blob/master/README.md) |
4
+ [简体中文](https://github.com/C0deBeez/dash-startup-loading-plugin/blob/master/README.zh-CN.md)
5
+
6
+ An installable [Dash Hooks plugin](https://dash.plotly.com/dash-plugins-using-hooks)
7
+ that replaces Dash's initial loading presentation with a configurable
8
+ full-screen overlay.
9
+
10
+ The plugin injects its CSS and JavaScript into Dash's normal index document
11
+ before React mounts. Applications do not need to copy assets or replace
12
+ `index_string`, and Dash's built-in `<div class="_dash-loading">` remains in the
13
+ document.
14
+
15
+ ## Requirements
16
+
17
+ - Python 3.9 or later
18
+ - Dash 3.0.3 or later
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ pip install "dash-startup-loading-plugin>=2.0.0"
24
+ ```
25
+
26
+ Dash discovers the plugin through its `dash_hooks` entry point. Installing the
27
+ package enables the default loading overlay without an explicit import.
28
+
29
+ The default background colors work with native Dash and Dash Ant Design.
30
+
31
+ ## Quick start
32
+
33
+ The plugin is discovered automatically, so a native Dash app needs no
34
+ plugin-specific code:
35
+
36
+ ```python
37
+ from dash import Dash, html
38
+
39
+ app = Dash(__name__)
40
+ app.layout = html.Main(
41
+ [
42
+ html.H1("My Dash app"),
43
+ html.P("The overlay closes after this layout is ready."),
44
+ ]
45
+ )
46
+
47
+ if __name__ == "__main__":
48
+ app.run(debug=True)
49
+ ```
50
+
51
+ The example above uses Dash's native components from `dash.html`. You can also
52
+ use the plugin with `dash-antd-components`:
53
+
54
+ ```bash
55
+ pip install dash-ant-design
56
+ ```
57
+
58
+ ```bash
59
+ uv add dash-ant-design
60
+ ```
61
+
62
+ ```python
63
+ import dash_antd_components as dac
64
+ from dash import Dash
65
+
66
+ app = Dash(__name__)
67
+ app.layout = dac.Space(
68
+ [
69
+ dac.Title("My Dash Ant Design app", level=2),
70
+ dac.Button("Continue", type="primary"),
71
+ dac.Input(placeholder="Search"),
72
+ ],
73
+ orientation="vertical",
74
+ size="middle",
75
+ )
76
+
77
+ if __name__ == "__main__":
78
+ app.run(debug=True)
79
+ ```
80
+
81
+ When the `dash-antd-components` bundle is present, the plugin automatically
82
+ uses Ant Design's four-dot loader unless `loader` is explicitly configured.
83
+ Native Dash apps use the Loading UI `ring` loader by default.
84
+
85
+ ### Theme behavior
86
+
87
+ Theme initialization belongs to the application. Set `dark`/`light` on the
88
+ root HTML element before Dash mounts, for example in `index_string`; the
89
+ plugin's CSS follows `html.dark`. This avoids a theme flash without making the
90
+ plugin own application preferences or asynchronous theme callbacks.
91
+ Use `prefers-color-scheme` in that head script when the application follows the
92
+ operating system preference.
93
+
94
+ ## Dash Ant Design
95
+
96
+ Dash Ant Design is optional. The same `setup()` function configures native Dash
97
+ and Dash Ant Design applications. When its component bundle is present and
98
+ `loader` was not explicitly configured, the plugin uses Ant Design's four-dot
99
+ loader and `colorPrimary` defaults. Other component libraries use Loading UI's
100
+ `ring` loader by default. Explicit loader and color options always take
101
+ precedence:
102
+
103
+ ```bash
104
+ pip install dash-ant-design
105
+ ```
106
+
107
+ ```bash
108
+ uv add dash-ant-design
109
+ ```
110
+
111
+ ```python
112
+ from dash_startup_loading_plugin import setup
113
+
114
+ setup(loader="antd")
115
+ ```
116
+
117
+ ## Dismissal behavior
118
+
119
+ By default, the plugin preserves its original behavior: it observes Dash's
120
+ standard `#react-entry-point` and closes the overlay after Dash's
121
+ `._dash-loading` element disappears. Theme initialization and application
122
+ specific callback/layout settling belong in the application's `index_string`
123
+ and callbacks.
124
+
125
+ ## Configuration
126
+
127
+ `setup(**changes)` updates the process-wide immutable
128
+ `StartupLoadingConfig`.
129
+
130
+ | Option | Default | Description |
131
+ | --- | ---: | --- |
132
+ | `enabled` | `True` | Enable index injection. |
133
+ | `aria_label` | `"Loading"` | Accessible status label. |
134
+ | `z_index` | `9999` | Overlay stacking order. |
135
+ | `loader_color` | `#1677ff` | Loader color in light mode. |
136
+ | `loader_dark_color` | `#1668dc` | Loader color in dark mode. |
137
+ | `loader_text_color` | `rgba(0,0,0,0.88)` | Text color for `text-*` Loading UI loaders in light mode. |
138
+ | `loader_dark_text_color` | `rgba(255,255,255,0.85)` | Text color for `text-*` Loading UI loaders in dark mode. |
139
+ | `loader` | `"default"` | Loading UI's `ring` animation. |
140
+ | `loader_text` | `"Loading"` | Text rendered by `text-*` Loading UI loaders. |
141
+ | `loader_size` | `64` | Target loader width and height. Loading UI uses its `ring` default of 4rem (64px); the `antd` loader uses Ant Design Spin's medium visual size of 20px. Other Loading UI loaders scale proportionally from their bundled default geometry. `None` uses the 64px baseline. |
142
+ | `loader_stroke_width` | `2` | Loading UI border and SVG stroke width, generated from its 2px default at the 64px ring baseline. |
143
+ | `custom_loader_html` | `None` | Trusted HTML replacing the default spinner. |
144
+
145
+ `custom_loader_html` is inserted verbatim and must never contain untrusted
146
+ user input.
147
+
148
+ The default loader uses Loading UI's `ring` animation. To use Ant Design's
149
+ four-dot loader, configure it explicitly:
150
+
151
+ ```python
152
+ setup(loader="antd")
153
+ ```
154
+
155
+ The overlay background follows the application's `html.dark` class and `--layout-bg` CSS variable, with `#f5f5f5` and `#111825` fallbacks. The plugin does not inspect ConfigProvider tokens. Explicit color options always take precedence. Use `loader_size`, `loader_color`, `loader_dark_color`, `loader_text_color`, and `loader_dark_text_color` to match a customized theme. Use `loader_text` to replace the default text in `text-*` loaders:
156
+
157
+ ```python
158
+ setup(loader="text-shimmer", loader_text="Preparing dashboard")
159
+ ```
160
+
161
+ ## Loader gallery
162
+
163
+ The effective default depends on the component bundle:
164
+
165
+ | Application | Default loader | Notes |
166
+ | --- | --- | --- |
167
+ | Native Dash components | `ring` | Loading UI renderer. |
168
+ | `dash-antd-components` | `antd` | Ant Design's four-dot spinner. |
169
+ | Any app with an explicit `setup(loader=...)` | The selected loader | Explicit configuration always wins. |
170
+
171
+ All Loading UI loaders are bundled separately and loaded only when selected.
172
+ The preview images below link to the official interactive demos. Open a preview
173
+ to see its live animation and source details. The `text-*` loaders accept
174
+ custom text through `loader_text`; `loader_color`, `loader_dark_color`,
175
+ `loader_size`, and `loader_stroke_width` apply where supported.
176
+
177
+ | Preview | Preview | Preview |
178
+ | --- | --- | --- |
179
+ | [![accordion-loader](https://loading-ui.com/api/og/components/accordion-loader/image.png)](https://loading-ui.com/docs/components/accordion-loader)<br>`accordion-loader` | [![analyzing-image](https://loading-ui.com/api/og/components/analyzing-image/image.png)](https://loading-ui.com/docs/components/analyzing-image)<br>`analyzing-image` | [![arc](https://loading-ui.com/api/og/components/arc/image.png)](https://loading-ui.com/docs/components/arc)<br>`arc` |
180
+ | [![bars](https://loading-ui.com/api/og/components/bars/image.png)](https://loading-ui.com/docs/components/bars)<br>`bars` | [![bobbing-dots](https://loading-ui.com/api/og/components/bobbing-dots/image.png)](https://loading-ui.com/docs/components/bobbing-dots)<br>`bobbing-dots` | [![bouncing-dots](https://loading-ui.com/api/og/components/bouncing-dots/image.png)](https://loading-ui.com/docs/components/bouncing-dots)<br>`bouncing-dots` |
181
+ | [![classic](https://loading-ui.com/api/og/components/classic/image.png)](https://loading-ui.com/docs/components/classic)<br>`classic` | [![clock-ring](https://loading-ui.com/api/og/components/clock-ring/image.png)](https://loading-ui.com/docs/components/clock-ring)<br>`clock-ring` | [![comet-spinner](https://loading-ui.com/api/og/components/comet-spinner/image.png)](https://loading-ui.com/docs/components/comet-spinner)<br>`comet-spinner` |
182
+ | [![concentric-ring](https://loading-ui.com/api/og/components/concentric-ring/image.png)](https://loading-ui.com/docs/components/concentric-ring)<br>`concentric-ring` | [![conveyor-loop](https://loading-ui.com/api/og/components/conveyor-loop/image.png)](https://loading-ui.com/docs/components/conveyor-loop)<br>`conveyor-loop` | [![dash-ring](https://loading-ui.com/api/og/components/dash-ring/image.png)](https://loading-ui.com/docs/components/dash-ring)<br>`dash-ring` |
183
+ | [![diamond](https://loading-ui.com/api/og/components/diamond/image.png)](https://loading-ui.com/docs/components/diamond)<br>`diamond` | [![dots](https://loading-ui.com/api/og/components/dots/image.png)](https://loading-ui.com/docs/components/dots)<br>`dots` | [![dots-ring](https://loading-ui.com/api/og/components/dots-ring/image.png)](https://loading-ui.com/docs/components/dots-ring)<br>`dots-ring` |
184
+ | [![dual-arc](https://loading-ui.com/api/og/components/dual-arc/image.png)](https://loading-ui.com/docs/components/dual-arc)<br>`dual-arc` | [![fade-arc](https://loading-ui.com/api/og/components/fade-arc/image.png)](https://loading-ui.com/docs/components/fade-arc)<br>`fade-arc` | [![infinity](https://loading-ui.com/api/og/components/infinity/image.png)](https://loading-ui.com/docs/components/infinity)<br>`infinity` |
185
+ | [![infinity-square-snake](https://loading-ui.com/api/og/components/infinity-square-snake/image.png)](https://loading-ui.com/docs/components/infinity-square-snake)<br>`infinity-square-snake` | [![infinity-track](https://loading-ui.com/api/og/components/infinity-track/image.png)](https://loading-ui.com/docs/components/infinity-track)<br>`infinity-track` | [![morphing-infinity](https://loading-ui.com/api/og/components/morphing-infinity/image.png)](https://loading-ui.com/docs/components/morphing-infinity)<br>`morphing-infinity` |
186
+ | [![orbit-ring](https://loading-ui.com/api/og/components/orbit-ring/image.png)](https://loading-ui.com/docs/components/orbit-ring)<br>`orbit-ring` | [![pulsating-dots](https://loading-ui.com/api/og/components/pulsating-dots/image.png)](https://loading-ui.com/docs/components/pulsating-dots)<br>`pulsating-dots` | [![pulse](https://loading-ui.com/api/og/components/pulse/image.png)](https://loading-ui.com/docs/components/pulse)<br>`pulse` |
187
+ | [![pulse-dot](https://loading-ui.com/api/og/components/pulse-dot/image.png)](https://loading-ui.com/docs/components/pulse-dot)<br>`pulse-dot` | [![quarter-ring](https://loading-ui.com/api/og/components/quarter-ring/image.png)](https://loading-ui.com/docs/components/quarter-ring)<br>`quarter-ring` | [![ring](https://loading-ui.com/api/og/components/ring/image.png)](https://loading-ui.com/docs/components/ring)<br>`ring` |
188
+ | [![ripple](https://loading-ui.com/api/og/components/ripple/image.png)](https://loading-ui.com/docs/components/ripple)<br>`ripple` | [![satellite-ring](https://loading-ui.com/api/og/components/satellite-ring/image.png)](https://loading-ui.com/docs/components/satellite-ring)<br>`satellite-ring` | [![skeleton](https://loading-ui.com/api/og/components/skeleton/image.png)](https://loading-ui.com/docs/components/skeleton)<br>`skeleton` |
189
+ | [![spiral](https://loading-ui.com/api/og/components/spiral/image.png)](https://loading-ui.com/docs/components/spiral)<br>`spiral` | [![spokes](https://loading-ui.com/api/og/components/spokes/image.png)](https://loading-ui.com/docs/components/spokes)<br>`spokes` | [![square-accordion](https://loading-ui.com/api/og/components/square-accordion/image.png)](https://loading-ui.com/docs/components/square-accordion)<br>`square-accordion` |
190
+ | [![square-grid](https://loading-ui.com/api/og/components/square-grid/image.png)](https://loading-ui.com/docs/components/square-grid)<br>`square-grid` | [![square-snake](https://loading-ui.com/api/og/components/square-snake/image.png)](https://loading-ui.com/docs/components/square-snake)<br>`square-snake` | [![swirling](https://loading-ui.com/api/og/components/swirling/image.png)](https://loading-ui.com/docs/components/swirling)<br>`swirling` |
191
+ | [![symmetric-wave](https://loading-ui.com/api/og/components/symmetric-wave/image.png)](https://loading-ui.com/docs/components/symmetric-wave)<br>`symmetric-wave` | [![terminal](https://loading-ui.com/api/og/components/terminal/image.png)](https://loading-ui.com/docs/components/terminal)<br>`terminal` | [![text-blink](https://loading-ui.com/api/og/components/text-blink/image.png)](https://loading-ui.com/docs/components/text-blink)<br>`text-blink` |
192
+ | [![text-dots](https://loading-ui.com/api/og/components/text-dots/image.png)](https://loading-ui.com/docs/components/text-dots)<br>`text-dots` | [![text-shimmer](https://loading-ui.com/api/og/components/text-shimmer/image.png)](https://loading-ui.com/docs/components/text-shimmer)<br>`text-shimmer` | [![text-shimmer-wave](https://loading-ui.com/api/og/components/text-shimmer-wave/image.png)](https://loading-ui.com/docs/components/text-shimmer-wave)<br>`text-shimmer-wave` |
193
+ | [![triple-dot-spinner](https://loading-ui.com/api/og/components/triple-dot-spinner/image.png)](https://loading-ui.com/docs/components/triple-dot-spinner)<br>`triple-dot-spinner` | [![twin-orbit](https://loading-ui.com/api/og/components/twin-orbit/image.png)](https://loading-ui.com/docs/components/twin-orbit)<br>`twin-orbit` | [![typing](https://loading-ui.com/api/og/components/typing/image.png)](https://loading-ui.com/docs/components/typing)<br>`typing` |
194
+ | [![wandering-eyes](https://loading-ui.com/api/og/components/wandering-eyes/image.png)](https://loading-ui.com/docs/components/wandering-eyes)<br>`wandering-eyes` | [![wave](https://loading-ui.com/api/og/components/wave/image.png)](https://loading-ui.com/docs/components/wave)<br>`wave` | [Default: ring](https://loading-ui.com/docs/components/ring)<br>`default` |
195
+ | [Ant Design Spin](https://ant.design/components/spin)<br>`antd` | | |
196
+
197
+ The bundled [Loading UI](https://loading-ui.com/) collection supports all 47 loader names in the current upstream catalog:
198
+
199
+ ```text
200
+ accordion-loader, analyzing-image, arc, bars, bobbing-dots, bouncing-dots, classic, clock-ring, comet-spinner, concentric-ring, conveyor-loop, dash-ring, diamond, dots, dots-ring, dual-arc, fade-arc, infinity, infinity-square-snake, infinity-track, morphing-infinity, orbit-ring, pulsating-dots, pulse, pulse-dot, quarter-ring, ring, ripple, satellite-ring, skeleton, spiral, spokes, square-accordion, square-grid, square-snake, swirling, symmetric-wave, terminal, text-blink, text-dots, text-shimmer, text-shimmer-wave, triple-dot-spinner, twin-orbit, typing, wandering-eyes, wave
201
+ ```
202
+
203
+ For example:
204
+
205
+ ```python
206
+ setup(loader="spiral", loader_color="#e91e63", loader_dark_color="#ff80ab")
207
+ ```
208
+
209
+ The default loader, `ring`, and other Loading UI loaders use a bundled, isolated renderer loaded before Dash starts. Each loader ships as its own bundle, and the index only references the selected one at `<requests_pathname_prefix>_dash-startup-loading/<loader>.js`. That keeps the HTML document small and lets the browser cache the renderer, so the choice of loader does not grow the first-screen payload. No other indicator is shown while that renderer starts. Loading UI loaders sit in a centered 4:3 region that uses full width below 640px, half width from 640px, one-third from 768px, and one-quarter from 1024px. Each loader keeps the geometry from its official demo: square icons use their documented `size-*`, rectangular loaders keep their documented aspect ratio, and character-grid loaders derive intrinsic `ch`/`em` dimensions from their default props. Text loaders fit their text.
210
+
211
+ ## Python API
212
+
213
+ ```python
214
+ from dash_startup_loading_plugin import (
215
+ StartupLoadingConfig,
216
+ setup,
217
+ get_config,
218
+ reset_config,
219
+ )
220
+ ```
221
+
222
+ ## Notes
223
+
224
+ - Dash's hook and plugin configuration is process-wide. Use one configuration
225
+ per process.
226
+ - Readiness gates apply only to startup. Later callbacks do not recreate the overlay.
227
+ - The overlay markup and its small startup runtime are inlined, so strict Content
228
+ Security Policy deployments must allow the injected style and script. The
229
+ Loading UI renderer is served from a plugin route instead of being inlined.
230
+ - The overlay is only for initial application startup. Use `dcc.Loading` or
231
+ another callback-specific pattern for later callback execution.
232
+
233
+ ## License
234
+
235
+ This project is distributed under the MIT License.
236
+
237
+ MIT
@@ -0,0 +1,55 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "dash-startup-loading-plugin"
7
+ version = "2.0.0"
8
+ description = "A configurable full-screen startup loading overlay for Dash apps, packaged as a Dash Hooks plugin."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ authors = [{ name = "Ethan Zhang", email = "ethan.zhang2016@gmail.com" }]
12
+ keywords = ["dash", "plotly", "loading", "plugin"]
13
+ classifiers = [
14
+ "Framework :: Dash",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3 :: Only",
17
+ "Programming Language :: Python :: 3.9",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ ]
23
+ license = "MIT"
24
+ license-files = ["LICENSE"]
25
+ dependencies = ["dash>=3.0.3", "typing-extensions>=4.11"]
26
+
27
+ [project.urls]
28
+ "Homepage" = "https://github.com/c0debeez/dash-startup-loading-plugin"
29
+ "Bug Reports" = "https://github.com/c0debeez/dash-startup-loading-plugin/issues"
30
+ "Source" = "https://github.com/c0debeez/dash-startup-loading-plugin"
31
+
32
+
33
+ [dependency-groups]
34
+ test = ["pytest>=8"]
35
+
36
+ [project.entry-points."dash_hooks"]
37
+ dash_startup_loading_plugin = "dash_startup_loading_plugin"
38
+
39
+ [tool.setuptools]
40
+ package-dir = { "" = "src" }
41
+ include-package-data = true
42
+
43
+ [tool.setuptools.packages.find]
44
+ where = ["src"]
45
+
46
+ [tool.setuptools.package-data]
47
+ dash_startup_loading_plugin = [
48
+ "resources/startup-loading.js",
49
+ "resources/loading-ui/*.js",
50
+ "py.typed",
51
+ ]
52
+
53
+ [tool.pytest.ini_options]
54
+ addopts = "-q -p no:cacheprovider"
55
+ testpaths = ["tests"]
@@ -0,0 +1,17 @@
1
+ """Full-screen startup loading overlay for Dash applications."""
2
+
3
+ from .plugin import (
4
+ StartupLoadingConfig,
5
+ __version__,
6
+ get_config,
7
+ reset_config,
8
+ setup,
9
+ )
10
+
11
+ __all__ = [
12
+ "StartupLoadingConfig",
13
+ "__version__",
14
+ "get_config",
15
+ "reset_config",
16
+ "setup",
17
+ ]