Skip to main content

Loading State
New

This template shows how to build a simple responsive loading state using Duet’s components. Please note that the example below does not represent a real use case.

Hint: Press F on your keyboard to view both templates and components in fullscreen and ESC to exit the fullscreen mode. You can also open the template in a new browser window.


Open in new window
<!DOCTYPE html>
<html class="duet-bg-gradient duet-sticky-footer" lang="fi">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>LähiTapiola</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@duetds/fonts@1.3.12/lib/localtapiola.css" integrity="sha384-5JYmtSD7nykpUvSmTW1CHMoBDkBZUpUmG0vuh+NUVtZag3F75Kr7+/JU3J7JV6Wq" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@duetds/css@1.4.6/lib/duet.min.css" integrity="sha384-pCjsyofCzuxv5DPuTf+kg3QNWqVN0ZwRTCgvvNWCkI38A42MtkN2EK2I2e28j+wB" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@duetds/tokens@2.0.30/lib/tokens.custom-properties.css" integrity="sha384-arb0dRY7eabL9qYMLabGqlrgO9p75pZ9lvaqh3xpLpNUUW6KBtRjKqkSwBv3HyLp" crossorigin="anonymous" />
<script type="module" src="https://cdn.jsdelivr.net/npm/@duetds/components@4.2.6/lib/duet/duet.esm.js" integrity="sha384-ytNH4bICrleu6OXiFr0GctdjoojY5a4B3/H3+Z0wTQOB9eUcbh6i7GbP2QykjM4k" crossorigin="anonymous"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/@duetds/components@4.2.6/lib/duet/duet.js" integrity="sha384-j/SZhqGHRSMeQPpiO0sIu1NANTpsXU23YSk3+nfvGaUM9SvRrOaN15rhsFO4k6L4" crossorigin="anonymous"></script>
</head>
<body>
<style>
/* You can remove the style block if you only need one theme. */
duet-spinner {
color: var(--color-primary);
}
.duet-theme-turva duet-spinner {
color: var(--color-primary-turva);
}
</style>
<duet-layout center middle>
<div slot="main">
<duet-visually-hidden>
<duet-heading level="h1">Ladataan sisältöä…</duet-heading>
<span class="msg" aria-live="assertive"></span>
</duet-visually-hidden>
<duet-spinner size="large" color="currentColor"></duet-spinner>
</div>
</duet-layout>
<duet-footer
variation="simple"
menu='[
{ "label": "Turvallisuus ja käyttöehdot", "href": "#" },
{ "label": "Evästeet", "href": "#" },
{ "label": "Henkilötietojen käsittely", "href": "#" }
]'
>

</duet-footer>
<script>
// Announce to screen reader users that we’re loading content
setTimeout(function() {
document.querySelector(".msg").innerHTML = "Ladataan sisältöä, odota hetki."
}, 500)
</script>
</body>
</html>

Integration

To install this template’s dependencies into your project, run:

npm install @duetds/components
npm install @duetds/css
npm install @duetds/fonts

For further guidelines, please see each package’s documentation.



Tutorials

Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:

Tutorials

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes

Tutorials

Usage With Markdown


Troubleshooting

If you experience any issues while using a template, please head over to the Support page for more guidelines and help.