You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of using the default round progress indicator, the following example shows how to implement a linear progress indicator.
228
+
229
+
In `wwwroot/css/app.css`, a CSS variable is used to pass the value of `--blazor-load-percentage` to the `scale` property of a blue pseudo-element that indicates the loading progress of the app's files:
230
+
231
+
```css
232
+
.linear-progress {
233
+
background: silver;
234
+
width: 50vw;
235
+
margin: 20%auto;
236
+
height: 1rem;
237
+
border-radius: 10rem;
238
+
overflow: hidden;
239
+
position: relative;
240
+
}
241
+
242
+
.linear-progress:after {
243
+
content: '';
244
+
position: absolute;
245
+
inset: 0;
246
+
background: blue;
247
+
scale: var(--blazor-load-percentage, 0%) 100%;
248
+
transform-origin: lefttop;
249
+
transition: scale ease-out0.5s;
250
+
}
251
+
```
252
+
253
+
As the app loads, `--blazor-load-percentage` is updated automatically, which dynamically changes the progress indicator's visual representation.
254
+
255
+
In `wwwroot/index.html`, remove the default SVG round indicator in `<div id="app">...</div>` and replace it with the following markup:
256
+
257
+
```html
258
+
<divclass="linear-progress"></div>
259
+
```
260
+
225
261
## Additional resources
226
262
227
263
*[Environments: Set the app's environment](xref:blazor/fundamentals/environments)
0 commit comments