Apps and sites
Full pages built with Design system 1 as it comes, with no library.
Each one uses only the components and the default look: Page lays out the screen, and units such as cards, tables, fields and buttons fill it. Turn on Show layers to mark what every part is made of, and point at any part to read its name. The code view holds the whole page to copy. Switch between Computer, Mobile and Tablet, or open an example full size. Changes stay in the preview.
General settings
Section titled “General settings”A complete settings page with a profile, regional preferences and message choices.
Point at any part of the page to see what it is made of.
<style>
.settings-stack { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--ds-unit); }
.settings-section { display:grid; grid-template-columns:calc(8 * var(--ds-unit)) minmax(0,1fr); gap:var(--ds-unit); padding-block:var(--ds-unit); }
.settings-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--ds-unit); }
.settings-actions { display:flex; flex-wrap:wrap; align-items:flex-end; gap:calc(var(--ds-unit) / 2); }
.settings-choice { display:flex; justify-content:space-between; align-items:flex-end; gap:var(--ds-unit); }
.settings-choice > ds-text { min-width:0; }
.settings-section h2 { margin:0; font:inherit; }
.settings-status:empty { display:none; }
@media(max-width:600px) { .settings-section,.settings-fields { grid-template-columns:minmax(0,1fr); } }
</style>
<ds-page layout="column" measure="40" data-ds-surface>
<div slot="header"><ds-text literal strong>Studio workspace</ds-text></div>
<div class="settings-stack">
<div class="settings-stack">
<ds-text literal size="display" role="heading" aria-level="1">General settings</ds-text>
<ds-text literal tone="muted" wrap>Make this space feel like yours.</ds-text>
</div>
<form id="settings-form" class="settings-stack">
<section class="settings-section" aria-labelledby="profile-heading">
<h2 id="profile-heading"><ds-text literal strong>Profile</ds-text></h2>
<div class="settings-stack">
<div class="settings-actions"><ds-avatar id="settings-avatar" initial="A" size="large" color="var(--one-sharp-pastel)"></ds-avatar><ds-text literal id="settings-profile-name">Alex Morgan</ds-text></div>
<div class="settings-fields">
<ds-input id="settings-name" label="Name" name="name" value="Alex Morgan" required></ds-input>
<ds-input label="Email" name="email" type="email" value="alex@example.com" required></ds-input>
<ds-input label="Workspace name" name="workspace" value="Studio" required></ds-input>
</div>
</div>
</section>
<section class="settings-section" aria-labelledby="preferences-heading">
<h2 id="preferences-heading"><ds-text literal strong>Preferences</ds-text></h2>
<div class="settings-stack">
<label class="settings-stack"><ds-text literal>Time zone</ds-text><ds-select><select name="timezone" aria-label="Time zone"><option value="Europe/London">London (Europe/London)</option value="Europe/Copenhagen">Copenhagen (Europe/Copenhagen)</option><option value="Asia/Tokyo">Tokyo (Asia/Tokyo)</option><option value="America/New_York">New York (America/New_York)</option></select></ds-select></label>
<div class="settings-fields">
<label class="settings-stack"><ds-text literal>Week starts on</ds-text><ds-select><select name="week" aria-label="Week starts on"><option>Monday</option><option>Sunday</option><option>Saturday</option></select></ds-select></label>
<label class="settings-stack"><ds-text literal>Time format</ds-text><ds-select><select name="clock" aria-label="Time format"><option value="24">24-hour</option><option value="12">12-hour</option></select></ds-select></label>
</div>
</div>
</section>
<section class="settings-section" aria-labelledby="notifications-heading">
<h2 id="notifications-heading"><ds-text literal strong>Notifications</ds-text></h2>
<div class="settings-stack">
<div class="settings-choice"><ds-text literal wrap>Email notifications</ds-text><ds-switch><button type="button" role="switch" aria-label="Email notifications" aria-checked="true" data-setting="email-notifications"></button></ds-switch></div>
<div class="settings-choice"><ds-text literal wrap>Weekly summary</ds-text><ds-switch><button type="button" role="switch" aria-label="Weekly summary" aria-checked="false" data-setting="weekly-summary"></button></ds-switch></div>
<div class="settings-choice"><ds-text literal wrap>Product news</ds-text><ds-switch><button type="button" role="switch" aria-label="Product news" aria-checked="false" data-setting="product-news"></button></ds-switch></div>
<ds-text literal size="small" tone="muted" wrap>Choose what reaches your inbox. Essential account messages stay on.</ds-text>
</div>
</section>
<div class="settings-actions">
<ds-button control="slotted" primary><button type="submit">Save changes</button></ds-button>
<ds-button control="slotted" secondary><button type="reset">Reset changes</button></ds-button>
</div>
<ds-text literal id="settings-status" class="settings-status" role="status" wrap></ds-text>
</form>
<ds-text literal tone="muted" size="small" wrap>Fictional settings. Changes stay in this preview and reset when you reload.</ds-text>
</div>
</ds-page> const form = document.querySelector('#settings-form');
const inputs = [...form.querySelectorAll('ds-input, select')];
const switches = [...form.querySelectorAll('[role="switch"]')];
const status = document.querySelector('#settings-status');
let saved = inputs.map(input => input.value);
let savedSwitches = switches.map(button => button.getAttribute('aria-checked'));
function changed() { status.textContent = 'Unsaved changes'; }
form.addEventListener('input', changed);
form.addEventListener('change', changed);
switches.forEach(button => button.addEventListener('click', () => {
button.setAttribute('aria-checked', String(button.getAttribute('aria-checked') !== 'true'));
changed();
}));
form.addEventListener('submit', event => {
event.preventDefault();
if (!form.reportValidity()) return;
saved = inputs.map(input => input.value);
savedSwitches = switches.map(button => button.getAttribute('aria-checked'));
const name = document.querySelector('#settings-name').value.trim();
document.querySelector('#settings-profile-name').textContent = name;
document.querySelector('#settings-avatar').setAttribute('initial', name.charAt(0).toUpperCase() || 'A');
status.textContent = 'Settings saved in this preview.';
});
form.addEventListener('reset', event => {
event.preventDefault();
inputs.forEach((input, index) => { input.value = saved[index]; });
switches.forEach((button, index) => button.setAttribute('aria-checked', savedSwitches[index]));
status.textContent = 'Changes reset to your last save.';
}); An editorial furniture catalogue, with a full collection and an itemised shopping bag.
Point at any part of the page to see what it is made of.
<style>
.example-stack { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--ds-unit); min-width:0; align-content:start; }
.example-tight { display:grid; grid-template-columns:minmax(0,1fr); gap:calc(var(--ds-unit) / 2); min-width:0; align-content:start; }
.example-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ds-unit); }
.example-two { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:calc(2 * var(--ds-unit)); align-items:start; }
.example-actions { display:flex; flex-wrap:wrap; align-items:flex-end; gap:calc(var(--ds-unit) / 2); }
.example-between { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end; gap:var(--ds-unit); }
.example-grow { flex:1; min-width:0; }
.example-section { padding-block:var(--ds-unit); }
.example-between > ds-input { width:calc(10 * var(--ds-unit)); max-width:100%; }
.example-overflow { overflow-x:auto; }
.example-rule { border-top:1px solid var(--ds-border-color); padding-top:var(--ds-unit); }
.example-caption { display:flex; justify-content:space-between; gap:var(--ds-unit); }
.example-caption > * { min-width:0; }
.example-nav { display:flex; justify-content:space-between; align-items:flex-end; gap:var(--ds-unit); }
.example-brand { flex:none; }
.example-footer { padding-top:var(--ds-unit); }
.example-stack [hidden], .example-grid [hidden], .example-two [hidden], .example-tight [hidden] { display:none!important; }
.example-status:empty { display:none; }
.example-title { --ds-sf:calc(2 * var(--sf, 1)); --ds-display-text-size:40px; --ds-typeface-regular:var(--typeface-compressed); }
.example-copy { max-width:calc(24 * var(--ds-unit)); }
.example-shop-hero { display:grid; grid-template-columns:2fr 3fr; gap:var(--ds-unit); align-items:stretch; }
.example-shop-intro { display:flex; flex-direction:column; justify-content:space-between; gap:calc(2 * var(--ds-unit)); padding-block:var(--ds-unit); }
.example-shop-hero ds-image { align-self:start; }
.example-story { display:grid; grid-template-columns:1fr 2fr; gap:calc(2 * var(--ds-unit)); padding-block:calc(2 * var(--ds-unit)); }
.example-product { display:grid; gap:calc(var(--ds-unit) / 2); min-width:0; }
.example-bag { padding-block:var(--ds-unit); border-block:1px solid var(--ds-border-color); }
.example-workspace { --ds-page-nav:calc(8 * var(--ds-unit)); --ds-page-gap:calc(2 * var(--ds-unit)); }
.example-workspace-nav { display:grid; gap:calc(2 * var(--ds-unit)); }
.example-week { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:calc(var(--ds-unit) / 2); }
.example-day { display:grid; gap:calc(var(--ds-unit) / 2); min-height:calc(4 * var(--ds-unit)); padding-block:calc(var(--ds-unit) / 2); border-top:1px solid var(--ds-border-color); }
.example-day[aria-current] { border-top-color:var(--ds-text-color); }
.example-work { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:calc(2 * var(--ds-unit)); }
.example-brief { display:grid; gap:calc(var(--ds-unit) / 2); }
.example-contact-sheet { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:calc(var(--ds-unit) / 2); }
.example-contact-sheet > :first-child { grid-column:1 / -1; }
.example-item { box-sizing:border-box; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:calc(var(--ds-unit) / 2); min-height:var(--ds-unit); align-items:end; border-bottom:1px solid var(--ds-border-color); }
.example-item label { display:flex; align-items:flex-end; gap:calc(var(--ds-unit) / 2); min-width:0; }
.example-item label ds-text { flex:1; }
.example-item-meta { display:flex; align-items:flex-end; gap:calc(var(--ds-unit) / 2); }
#balance-stat { --ds-stat-size:40px; --ds-stat-lines:3; --ds-stat-typeface:var(--typeface-compressed); }
.example-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ds-unit); }
.example-cash { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,1fr); gap:calc(2 * var(--ds-unit)); }
.example-goal { display:grid; grid-template-columns:calc(6 * var(--ds-unit)) minmax(0,1fr); gap:var(--ds-unit); align-items:center; }
.example-audio-hero { display:grid; grid-template-columns:1fr 1fr; gap:var(--ds-unit); }
.example-audio-copy { display:flex; flex-direction:column; justify-content:space-between; gap:var(--ds-unit); padding:var(--ds-unit); background:var(--one-pink-pastel); }
.example-audio-copy .example-title { --ds-typeface-regular:var(--typeface-regular); }
.example-audio-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ds-unit); padding-block:var(--ds-unit); }
.example-audio-detail { display:grid; grid-template-columns:1fr 1fr; gap:calc(2 * var(--ds-unit)); align-items:center; }
.example-package { display:grid; grid-template-columns:1fr 1fr; gap:calc(2 * var(--ds-unit)); padding-block:calc(2 * var(--ds-unit)); }
.example-specs { display:grid; gap:0; }
.example-specs > div { display:flex; justify-content:space-between; gap:var(--ds-unit); border-bottom:1px solid var(--ds-border-color); padding-block:calc(var(--ds-unit) / 2); }
@media(max-width:900px) { .example-title { --ds-sf:var(--sf, 1); } .example-work { grid-template-columns:1fr; } .example-brief { grid-template-columns:1fr 1fr; gap:var(--ds-unit); } .example-cash { grid-template-columns:minmax(0,1fr); } }
@media(max-width:600px) {
.example-title { --ds-sf:var(--sf, 1); --ds-display-text-size:30px; }
.example-shop-hero,.example-audio-hero,.example-audio-detail,.example-package,.example-two,.example-story,.example-brief { grid-template-columns:1fr; gap:var(--ds-unit); }
.example-shop-intro { padding-block:0; gap:var(--ds-unit); }
.example-shop-hero { --hero-ratio:4 / 3; }
.example-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--ds-unit) calc(var(--ds-unit) / 2); }
.example-grid > :first-child { grid-column:1 / -1; }
.example-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
.example-stats > :first-child { grid-column:1 / -1; }
.example-audio-strip { grid-template-columns:1fr; }
.example-week { gap:calc(var(--ds-unit) / 2); }
.example-day { min-height:calc(3 * var(--ds-unit)); }
.example-day ds-text[size=small] { display:none; }
.example-nav .example-nav-secondary { display:none; }
.example-goal { grid-template-columns:calc(4 * var(--ds-unit)) minmax(0,1fr); }
.example-item { grid-template-columns:1fr; }
.example-item-meta { padding-inline-start:calc(1.5 * var(--ds-unit)); }
.example-package { padding-block:var(--ds-unit); }
}
</style><ds-page layout="column" measure="52" data-ds-surface>
<div slot="header" class="example-nav"><ds-text literal strong size="display" class="example-brand">Room</ds-text><div class="example-actions"><ds-button href="#collection">Collection</ds-button><ds-button href="#story" class="example-nav-secondary">About Room</ds-button><ds-button id="bag" secondary>Bag · 0</ds-button></div></div>
<div class="example-stack">
<section class="example-shop-hero">
<div class="example-shop-intro"><div class="example-tight"><ds-text literal size="small" tone="muted" wrap>Furniture, objects & everyday rituals</ds-text><ds-text literal size="display" class="example-title" wrap role="heading" aria-level="1">A room is never really finished.</ds-text></div><div class="example-stack example-copy"><div data-ds-prose><p>A chair pulled up. A cup set down. A few things that make a place your own.</p></div><div><ds-button href="#collection" primary>Find your next favourite <ds-icon type="down" aria-hidden="true"></ds-icon></ds-button></div><ds-text literal size="small" tone="muted">The autumn collection</ds-text></div></div>
<ds-image src="/examples/images/room.jpg" alt="A cane chair in a room filled with afternoon light" ratio="var(--hero-ratio, 6 / 5)" loading="eager" position="50% 75%"></ds-image>
</section>
<div class="example-caption"><ds-text literal size="small" tone="muted">Good things. Kept for years.</ds-text><ds-text literal size="small" tone="muted">Made for living</ds-text></div>
<section id="collection" class="example-stack example-section">
<div class="example-between"><ds-text literal size="display" strong wrap role="heading" aria-level="2">The everyday collection</ds-text><div class="example-actions" role="group" aria-label="Filter collection"><ds-button control="host" data-category="all" active aria-pressed="true">All</ds-button><ds-button control="host" data-category="furniture" aria-pressed="false">Furniture</ds-button><ds-button control="host" data-category="objects" aria-pressed="false">Objects</ds-button></div></div>
<div class="example-grid">
<article class="example-product" data-product="furniture"><ds-image src="/examples/images/chair.jpg" alt="Everyday chair, a wooden chair with a slatted back" ratio="1" ></ds-image><div class="example-caption"><ds-text literal strong wrap>Everyday chair</ds-text><ds-text literal >€180</ds-text></div><ds-text literal tone="muted" size="small" wrap>Wood, with a little character.</ds-text><div><ds-button secondary data-add="Everyday chair" data-price="180"><ds-icon type="plus" aria-hidden="true"></ds-icon> Add to bag</ds-button></div></article>
<article class="example-product" data-product="objects"><ds-image src="/examples/images/cup.jpg" alt="A speckled ceramic cup" ratio="1" ></ds-image><div class="example-caption"><ds-text literal strong wrap>Morning cup</ds-text><ds-text literal >€28</ds-text></div><ds-text literal tone="muted" size="small" wrap>For the first ten quiet minutes.</ds-text><div><ds-button secondary data-add="Morning cup" data-price="28"><ds-icon type="plus" aria-hidden="true"></ds-icon> Add to bag</ds-button></div></article>
<article class="example-product" data-product="objects"><ds-image src="/examples/images/forest.webp" alt="A sunlit trail through a green forest" ratio="1" ></ds-image><div class="example-caption"><ds-text literal strong wrap>Forest print</ds-text><ds-text literal >€45</ds-text></div><ds-text literal tone="muted" size="small" wrap>A window into somewhere else.</ds-text><div><ds-button secondary data-add="Forest print" data-price="45"><ds-icon type="plus" aria-hidden="true"></ds-icon> Add to bag</ds-button></div></article>
</div>
<ds-text id="shop-status" class="example-status" literal role="status" wrap></ds-text>
<section id="bag-summary" class="example-stack example-bag" hidden aria-label="Your bag"><div class="example-between"><ds-text literal size="display" strong wrap role="heading" aria-level="2">Your bag</ds-text><ds-button id="clear-bag">Empty bag</ds-button></div><ds-list id="bag-items"></ds-list><ds-text id="bag-content" literal wrap></ds-text></section>
</section>
<section id="story" class="example-story example-rule"><div><ds-text literal size="display" strong wrap role="heading" aria-level="2">Less, but more lived in.</ds-text></div><div class="example-stack"><div data-ds-prose><p>We look for pieces with a useful shape and a reason to stay. Nothing too precious to touch. Nothing that needs a special occasion.</p><p>Put your feet up. Leave the book open. Let the room become yours.</p></div><div class="example-actions"><ds-tag>Useful by nature</ds-tag><ds-tag>Better with time</ds-tag></div></div></section>
</div><div slot="footer" class="example-footer"><ds-text literal size="small" tone="muted" wrap>Fictional demo. Your changes stay here.</ds-text></div></ds-page> const items = new Map();
const bag = document.querySelector('#bag');
const summary = document.querySelector('#bag-summary');
function renderBag() {
let count=0,total=0; const list=document.querySelector('#bag-items'); list.replaceChildren();
for(const [name,item] of items){
count+=item.quantity; total+=item.quantity*item.price;
const row=document.createElement('ds-row'); row.setAttribute('fill','');
const words=document.createElement('ds-text'); words.setAttribute('literal',''); words.setAttribute('wrap',''); words.textContent=name+' × '+item.quantity;
const remove=document.createElement('ds-button'); remove.textContent='Remove'; remove.setAttribute('label','Remove '+name);
remove.addEventListener('click',()=>{if(--item.quantity===0)items.delete(name);renderBag();document.querySelector('#shop-status').textContent=name+' removed.';});
row.append(words,remove);list.append(row);
}
bag.textContent='Bag · '+count;
document.querySelector('#bag-content').textContent=count?'Subtotal €'+total+'. No payment is taken in this demo.':'Your bag is empty. Find something in the collection.';
}
document.querySelectorAll('[data-add]').forEach(button=>button.addEventListener('click',()=>{const name=button.dataset.add;const item=items.get(name)||{quantity:0,price:Number(button.dataset.price)};item.quantity++;items.set(name,item);renderBag();document.querySelector('#shop-status').textContent=name+' added to your bag.';}));
bag.addEventListener('click',()=>{renderBag();summary.hidden=!summary.hidden;if(!summary.hidden)summary.scrollIntoView({block:'nearest'});});
document.querySelector('#clear-bag').addEventListener('click',()=>{items.clear();renderBag();document.querySelector('#shop-status').textContent='Bag emptied.';});
document.querySelectorAll('[data-category]').forEach(button=>button.addEventListener('click',()=>{
document.querySelectorAll('[data-category]').forEach(item=>{item.toggleAttribute('active',item===button);item.setAttribute('aria-pressed',String(item===button));});
document.querySelectorAll('[data-product]').forEach(item=>{item.hidden=button.dataset.category!=='all'&&item.dataset.product!==button.dataset.category;});
})); Planning app
Section titled “Planning app”A studio launch week, with assignments, progress and an expanding visual brief.
Point at any part of the page to see what it is made of.
<style>
.example-stack { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--ds-unit); min-width:0; align-content:start; }
.example-tight { display:grid; grid-template-columns:minmax(0,1fr); gap:calc(var(--ds-unit) / 2); min-width:0; align-content:start; }
.example-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ds-unit); }
.example-two { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:calc(2 * var(--ds-unit)); align-items:start; }
.example-actions { display:flex; flex-wrap:wrap; align-items:flex-end; gap:calc(var(--ds-unit) / 2); }
.example-between { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end; gap:var(--ds-unit); }
.example-grow { flex:1; min-width:0; }
.example-section { padding-block:var(--ds-unit); }
.example-between > ds-input { width:calc(10 * var(--ds-unit)); max-width:100%; }
.example-overflow { overflow-x:auto; }
.example-rule { border-top:1px solid var(--ds-border-color); padding-top:var(--ds-unit); }
.example-caption { display:flex; justify-content:space-between; gap:var(--ds-unit); }
.example-caption > * { min-width:0; }
.example-nav { display:flex; justify-content:space-between; align-items:flex-end; gap:var(--ds-unit); }
.example-brand { flex:none; }
.example-footer { padding-top:var(--ds-unit); }
.example-stack [hidden], .example-grid [hidden], .example-two [hidden], .example-tight [hidden] { display:none!important; }
.example-status:empty { display:none; }
.example-title { --ds-sf:calc(2 * var(--sf, 1)); --ds-display-text-size:40px; --ds-typeface-regular:var(--typeface-compressed); }
.example-copy { max-width:calc(24 * var(--ds-unit)); }
.example-shop-hero { display:grid; grid-template-columns:2fr 3fr; gap:var(--ds-unit); align-items:stretch; }
.example-shop-intro { display:flex; flex-direction:column; justify-content:space-between; gap:calc(2 * var(--ds-unit)); padding-block:var(--ds-unit); }
.example-shop-hero ds-image { align-self:start; }
.example-story { display:grid; grid-template-columns:1fr 2fr; gap:calc(2 * var(--ds-unit)); padding-block:calc(2 * var(--ds-unit)); }
.example-product { display:grid; gap:calc(var(--ds-unit) / 2); min-width:0; }
.example-bag { padding-block:var(--ds-unit); border-block:1px solid var(--ds-border-color); }
.example-workspace { --ds-page-nav:calc(8 * var(--ds-unit)); --ds-page-gap:calc(2 * var(--ds-unit)); }
.example-workspace-nav { display:grid; gap:calc(2 * var(--ds-unit)); }
.example-week { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:calc(var(--ds-unit) / 2); }
.example-day { display:grid; gap:calc(var(--ds-unit) / 2); min-height:calc(4 * var(--ds-unit)); padding-block:calc(var(--ds-unit) / 2); border-top:1px solid var(--ds-border-color); }
.example-day[aria-current] { border-top-color:var(--ds-text-color); }
.example-work { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:calc(2 * var(--ds-unit)); }
.example-brief { display:grid; gap:calc(var(--ds-unit) / 2); }
.example-contact-sheet { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:calc(var(--ds-unit) / 2); }
.example-contact-sheet > :first-child { grid-column:1 / -1; }
.example-item { box-sizing:border-box; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:calc(var(--ds-unit) / 2); min-height:var(--ds-unit); align-items:end; border-bottom:1px solid var(--ds-border-color); }
.example-item label { display:flex; align-items:flex-end; gap:calc(var(--ds-unit) / 2); min-width:0; }
.example-item label ds-text { flex:1; }
.example-item-meta { display:flex; align-items:flex-end; gap:calc(var(--ds-unit) / 2); }
#balance-stat { --ds-stat-size:40px; --ds-stat-lines:3; --ds-stat-typeface:var(--typeface-compressed); }
.example-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ds-unit); }
.example-cash { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,1fr); gap:calc(2 * var(--ds-unit)); }
.example-goal { display:grid; grid-template-columns:calc(6 * var(--ds-unit)) minmax(0,1fr); gap:var(--ds-unit); align-items:center; }
.example-audio-hero { display:grid; grid-template-columns:1fr 1fr; gap:var(--ds-unit); }
.example-audio-copy { display:flex; flex-direction:column; justify-content:space-between; gap:var(--ds-unit); padding:var(--ds-unit); background:var(--one-pink-pastel); }
.example-audio-copy .example-title { --ds-typeface-regular:var(--typeface-regular); }
.example-audio-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ds-unit); padding-block:var(--ds-unit); }
.example-audio-detail { display:grid; grid-template-columns:1fr 1fr; gap:calc(2 * var(--ds-unit)); align-items:center; }
.example-package { display:grid; grid-template-columns:1fr 1fr; gap:calc(2 * var(--ds-unit)); padding-block:calc(2 * var(--ds-unit)); }
.example-specs { display:grid; gap:0; }
.example-specs > div { display:flex; justify-content:space-between; gap:var(--ds-unit); border-bottom:1px solid var(--ds-border-color); padding-block:calc(var(--ds-unit) / 2); }
@media(max-width:900px) { .example-title { --ds-sf:var(--sf, 1); } .example-work { grid-template-columns:1fr; } .example-brief { grid-template-columns:1fr 1fr; gap:var(--ds-unit); } .example-cash { grid-template-columns:minmax(0,1fr); } }
@media(max-width:600px) {
.example-title { --ds-sf:var(--sf, 1); --ds-display-text-size:30px; }
.example-shop-hero,.example-audio-hero,.example-audio-detail,.example-package,.example-two,.example-story,.example-brief { grid-template-columns:1fr; gap:var(--ds-unit); }
.example-shop-intro { padding-block:0; gap:var(--ds-unit); }
.example-shop-hero { --hero-ratio:4 / 3; }
.example-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--ds-unit) calc(var(--ds-unit) / 2); }
.example-grid > :first-child { grid-column:1 / -1; }
.example-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
.example-stats > :first-child { grid-column:1 / -1; }
.example-audio-strip { grid-template-columns:1fr; }
.example-week { gap:calc(var(--ds-unit) / 2); }
.example-day { min-height:calc(3 * var(--ds-unit)); }
.example-day ds-text[size=small] { display:none; }
.example-nav .example-nav-secondary { display:none; }
.example-goal { grid-template-columns:calc(4 * var(--ds-unit)) minmax(0,1fr); }
.example-item { grid-template-columns:1fr; }
.example-item-meta { padding-inline-start:calc(1.5 * var(--ds-unit)); }
.example-package { padding-block:var(--ds-unit); }
}
</style><ds-page layout="sidebar" drawer divided fill class="example-workspace" data-ds-surface>
<div slot="nav" class="example-workspace-nav"><ds-row><ds-avatar initial="S" color="var(--one-sharp-pastel)"></ds-avatar><ds-text literal strong>Studio</ds-text></ds-row><ds-sidebar label="Studio navigation" id="planner-nav"></ds-sidebar><div class="example-tight"><ds-text literal size="small" tone="muted">The team</ds-text><ds-avatar-group label="Project team"><ds-avatar initial="A" color="var(--one-pink)"></ds-avatar><ds-avatar initial="M" color="var(--one-sharp-pastel)"></ds-avatar><ds-avatar initial="R" color="var(--one-orange-pastel)"></ds-avatar></ds-avatar-group><ds-text literal size="small" tone="muted">Alex, Mika & Ren</ds-text></div></div>
<div slot="header" class="example-between"><ds-text literal strong id="planner-heading">Today</ds-text><ds-tag>Autumn collection</ds-tag></div>
<div class="example-stack">
<div class="example-between"><div class="example-tight"><ds-text literal size="display" strong wrap role="heading" aria-level="1">A good week starts here.</ds-text><ds-text literal tone="muted" wrap>Monday, 19 October. Launch in four days.</ds-text></div><ds-stat id="planner-progress" value="1" figure="1 of 4" label="Ready for launch" literal></ds-stat></div>
<div class="example-week" aria-label="Launch week"><div class="example-day" aria-current="date"><ds-text literal size="small" tone="muted">Mon</ds-text><ds-text literal size="display">19</ds-text><ds-text literal size="small" wrap>Photographs</ds-text></div><div class="example-day" ><ds-text literal size="small" tone="muted">Tue</ds-text><ds-text literal size="display">20</ds-text><ds-text literal size="small" wrap>Design review</ds-text></div><div class="example-day" ><ds-text literal size="small" tone="muted">Wed</ds-text><ds-text literal size="display">21</ds-text><ds-text literal size="small" wrap>Print files</ds-text></div><div class="example-day" ><ds-text literal size="small" tone="muted">Thu</ds-text><ds-text literal size="display">22</ds-text><ds-text literal size="small" wrap>Final checks</ds-text></div><div class="example-day" ><ds-text literal size="small" tone="muted">Fri</ds-text><ds-text literal size="display">23</ds-text><ds-text literal size="small" wrap>Launch day</ds-text></div></div>
<div class="example-work">
<section class="example-stack"><div class="example-between"><ds-text literal size="display" strong wrap role="heading" aria-level="2">Make it happen</ds-text><ds-tag id="item-count">3 items</ds-tag></div><ds-input id="item-search" type="search" placeholder="Find an item" label="Find an item"></ds-input><div id="work-items"></div><ds-text literal id="planner-empty" tone="muted" wrap hidden>No items here. Try another view or search.</ds-text><div class="example-actions"><ds-input id="new-item" class="example-grow" label="New item" placeholder="What needs doing?"></ds-input><ds-button id="add-item" secondary><ds-icon type="plus" aria-hidden="true"></ds-icon> Add item</ds-button></div><ds-text id="planner-status" class="example-status" literal role="status" wrap></ds-text></section>
<section class="example-brief"><div class="example-contact-sheet"><ds-image src="/examples/images/room.jpg" alt="Chair by the window: location reference" ratio="16 / 7" position="50% 75%"></ds-image><ds-image src="/examples/images/chair.jpg" alt="Wooden chair: product reference" ratio="1" ></ds-image><ds-image src="/examples/images/cup.jpg" alt="Ceramic cup: material reference" ratio="1" ></ds-image></div><div class="example-tight"><ds-text literal strong>Collection shoot</ds-text><ds-text literal wrap tone="muted">Natural light. Familiar objects. An ordinary morning, looked at a little longer.</ds-text><ds-text literal size="small" tone="muted">Mika added 3 references</ds-text><ds-button control="slotted"><button id="brief-toggle" type="button" aria-expanded="false" aria-controls="brief-details">Read the brief <ds-icon type="down" aria-hidden="true"></ds-icon></button></ds-button><div id="brief-details" data-ds-prose hidden><p>Set the chair beside the window. Shoot the full room first, then the grain, the handle and the edge of the cup.</p><p>Deliver six landscape crops and three portraits by Tuesday’s review.</p></div></div></section>
</div>
<section class="example-tight example-rule"><ds-text literal strong>Coming together</ds-text><ds-row><ds-avatar initial="R" color="var(--one-orange-pastel)"></ds-avatar><ds-text literal wrap>Ren sent the print files</ds-text><span class="example-grow"></span><ds-text literal size="small" tone="muted">09:12</ds-text></ds-row><ds-row><ds-avatar initial="M" color="var(--one-sharp-pastel)"></ds-avatar><ds-text literal wrap>Mika added the shoot references</ds-text><span class="example-grow"></span><ds-text literal size="small" tone="muted">08:45</ds-text></ds-row></section>
</div><div slot="footer" class="example-footer"><ds-text literal size="small" tone="muted" wrap>Fictional demo. Your changes stay here.</ds-text></div></ds-page> const navigation = document.querySelector('#planner-nav');
let view = 'today';
const items = [{name:'Choose the final photographs',done:false,owner:'M',due:'Today'},{name:'Review the collection page',done:false,owner:'A',due:'Tue'},{name:'Send the print files',done:true,owner:'R',due:'Done'},{name:'Write the launch note',done:false,owner:'A',due:'Thu'}];
function render() {
navigation.items = [{id:'today',label:'Today',current:view==='today'},{id:'all',label:'All items',current:view==='all'},{id:'completed',label:'Completed',current:view==='completed'}];
document.querySelector('#planner-heading').textContent = view === 'completed' ? 'Completed' : view === 'all' ? 'All items' : 'Today';
const query = document.querySelector('#item-search').value.toLowerCase();
const list = document.querySelector('#work-items'); list.replaceChildren();
items.forEach((item,index) => {
if ((view==='completed' && !item.done) || (view==='today' && item.done) || !item.name.toLowerCase().includes(query)) return;
const row = document.createElement('div'); row.className='example-item'; const label = document.createElement('label'); label.className = 'example-actions'; const face = document.createElement('ds-checkbox'); const check = document.createElement('input'); check.type='checkbox'; check.checked=item.done; face.append(check); const words=document.createElement('ds-text'); words.setAttribute('literal',''); words.textContent=item.name; words.setAttribute('wrap',''); label.append(face,words); const meta=document.createElement('div'); meta.className='example-item-meta'; const due=document.createElement('ds-text');due.setAttribute('literal','');due.setAttribute('size','small');due.setAttribute('tone','muted');due.textContent=item.due||'Unscheduled';const avatar=document.createElement('ds-avatar');avatar.setAttribute('initial',item.owner||'A');meta.append(due,avatar);
check.addEventListener('change', () => { item.done = check.checked; document.querySelector('#planner-status').textContent = item.name + (item.done ? ' completed.' : ' reopened.'); render(); });
row.append(label,meta); list.append(row);
});
document.querySelector('#item-count').textContent = list.children.length + ' items';
document.querySelector('#planner-empty').hidden=Boolean(list.children.length);
document.querySelector('#planner-progress').figure=items.filter(item=>item.done).length+' of '+items.length;
}
document.querySelector('#brief-toggle').addEventListener('click',event=>{const details=document.querySelector('#brief-details');details.hidden=!details.hidden;event.currentTarget.setAttribute('aria-expanded',String(!details.hidden));});
navigation.addEventListener('sidebar-activate', event => { view = event.detail.id; render(); document.querySelector('ds-page').closeDrawer(); });
document.querySelector('#item-search').addEventListener('input',render);
function add() { const input=document.querySelector('#new-item'); const name=input.value.trim(); if (!name) { input.focus(); return; } items.push({name,done:false}); input.value=''; view='all'; render(); document.querySelector('#planner-status').textContent='Item added.'; }
document.querySelector('#add-item').addEventListener('click',add);
document.querySelector('#new-item').addEventListener('keydown',event => { if(event.key==='Enter') add(); });
render(); Finance app
Section titled “Finance app”An open ledger whose balances, cash flow and spending follow the selected account.
Point at any part of the page to see what it is made of.
<style>
.example-stack { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--ds-unit); min-width:0; align-content:start; }
.example-tight { display:grid; grid-template-columns:minmax(0,1fr); gap:calc(var(--ds-unit) / 2); min-width:0; align-content:start; }
.example-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ds-unit); }
.example-two { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:calc(2 * var(--ds-unit)); align-items:start; }
.example-actions { display:flex; flex-wrap:wrap; align-items:flex-end; gap:calc(var(--ds-unit) / 2); }
.example-between { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end; gap:var(--ds-unit); }
.example-grow { flex:1; min-width:0; }
.example-section { padding-block:var(--ds-unit); }
.example-between > ds-input { width:calc(10 * var(--ds-unit)); max-width:100%; }
.example-overflow { overflow-x:auto; }
.example-rule { border-top:1px solid var(--ds-border-color); padding-top:var(--ds-unit); }
.example-caption { display:flex; justify-content:space-between; gap:var(--ds-unit); }
.example-caption > * { min-width:0; }
.example-nav { display:flex; justify-content:space-between; align-items:flex-end; gap:var(--ds-unit); }
.example-brand { flex:none; }
.example-footer { padding-top:var(--ds-unit); }
.example-stack [hidden], .example-grid [hidden], .example-two [hidden], .example-tight [hidden] { display:none!important; }
.example-status:empty { display:none; }
.example-title { --ds-sf:calc(2 * var(--sf, 1)); --ds-display-text-size:40px; --ds-typeface-regular:var(--typeface-compressed); }
.example-copy { max-width:calc(24 * var(--ds-unit)); }
.example-shop-hero { display:grid; grid-template-columns:2fr 3fr; gap:var(--ds-unit); align-items:stretch; }
.example-shop-intro { display:flex; flex-direction:column; justify-content:space-between; gap:calc(2 * var(--ds-unit)); padding-block:var(--ds-unit); }
.example-shop-hero ds-image { align-self:start; }
.example-story { display:grid; grid-template-columns:1fr 2fr; gap:calc(2 * var(--ds-unit)); padding-block:calc(2 * var(--ds-unit)); }
.example-product { display:grid; gap:calc(var(--ds-unit) / 2); min-width:0; }
.example-bag { padding-block:var(--ds-unit); border-block:1px solid var(--ds-border-color); }
.example-workspace { --ds-page-nav:calc(8 * var(--ds-unit)); --ds-page-gap:calc(2 * var(--ds-unit)); }
.example-workspace-nav { display:grid; gap:calc(2 * var(--ds-unit)); }
.example-week { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:calc(var(--ds-unit) / 2); }
.example-day { display:grid; gap:calc(var(--ds-unit) / 2); min-height:calc(4 * var(--ds-unit)); padding-block:calc(var(--ds-unit) / 2); border-top:1px solid var(--ds-border-color); }
.example-day[aria-current] { border-top-color:var(--ds-text-color); }
.example-work { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:calc(2 * var(--ds-unit)); }
.example-brief { display:grid; gap:calc(var(--ds-unit) / 2); }
.example-contact-sheet { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:calc(var(--ds-unit) / 2); }
.example-contact-sheet > :first-child { grid-column:1 / -1; }
.example-item { box-sizing:border-box; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:calc(var(--ds-unit) / 2); min-height:var(--ds-unit); align-items:end; border-bottom:1px solid var(--ds-border-color); }
.example-item label { display:flex; align-items:flex-end; gap:calc(var(--ds-unit) / 2); min-width:0; }
.example-item label ds-text { flex:1; }
.example-item-meta { display:flex; align-items:flex-end; gap:calc(var(--ds-unit) / 2); }
#balance-stat { --ds-stat-size:40px; --ds-stat-lines:3; --ds-stat-typeface:var(--typeface-compressed); }
.example-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ds-unit); }
.example-cash { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,1fr); gap:calc(2 * var(--ds-unit)); }
.example-goal { display:grid; grid-template-columns:calc(6 * var(--ds-unit)) minmax(0,1fr); gap:var(--ds-unit); align-items:center; }
.example-audio-hero { display:grid; grid-template-columns:1fr 1fr; gap:var(--ds-unit); }
.example-audio-copy { display:flex; flex-direction:column; justify-content:space-between; gap:var(--ds-unit); padding:var(--ds-unit); background:var(--one-pink-pastel); }
.example-audio-copy .example-title { --ds-typeface-regular:var(--typeface-regular); }
.example-audio-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ds-unit); padding-block:var(--ds-unit); }
.example-audio-detail { display:grid; grid-template-columns:1fr 1fr; gap:calc(2 * var(--ds-unit)); align-items:center; }
.example-package { display:grid; grid-template-columns:1fr 1fr; gap:calc(2 * var(--ds-unit)); padding-block:calc(2 * var(--ds-unit)); }
.example-specs { display:grid; gap:0; }
.example-specs > div { display:flex; justify-content:space-between; gap:var(--ds-unit); border-bottom:1px solid var(--ds-border-color); padding-block:calc(var(--ds-unit) / 2); }
@media(max-width:900px) { .example-title { --ds-sf:var(--sf, 1); } .example-work { grid-template-columns:1fr; } .example-brief { grid-template-columns:1fr 1fr; gap:var(--ds-unit); } .example-cash { grid-template-columns:minmax(0,1fr); } }
@media(max-width:600px) {
.example-title { --ds-sf:var(--sf, 1); --ds-display-text-size:30px; }
.example-shop-hero,.example-audio-hero,.example-audio-detail,.example-package,.example-two,.example-story,.example-brief { grid-template-columns:1fr; gap:var(--ds-unit); }
.example-shop-intro { padding-block:0; gap:var(--ds-unit); }
.example-shop-hero { --hero-ratio:4 / 3; }
.example-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--ds-unit) calc(var(--ds-unit) / 2); }
.example-grid > :first-child { grid-column:1 / -1; }
.example-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
.example-stats > :first-child { grid-column:1 / -1; }
.example-audio-strip { grid-template-columns:1fr; }
.example-week { gap:calc(var(--ds-unit) / 2); }
.example-day { min-height:calc(3 * var(--ds-unit)); }
.example-day ds-text[size=small] { display:none; }
.example-nav .example-nav-secondary { display:none; }
.example-goal { grid-template-columns:calc(4 * var(--ds-unit)) minmax(0,1fr); }
.example-item { grid-template-columns:1fr; }
.example-item-meta { padding-inline-start:calc(1.5 * var(--ds-unit)); }
.example-package { padding-block:var(--ds-unit); }
}
</style><ds-page layout="sidebar" drawer divided fill class="example-workspace" data-ds-surface>
<div slot="nav" class="example-workspace-nav"><ds-row><ds-avatar initial="L" color="var(--one-chartreuse-pastel)"></ds-avatar><ds-text literal strong>Ledger</ds-text></ds-row><ds-sidebar label="Accounts" id="finance-nav"></ds-sidebar><div class="example-tight"><ds-text literal size="small" tone="muted">Your next chapter</ds-text><ds-image src="/examples/images/lake.jpg" alt="A mountain lake, the destination of a savings goal" ratio="4 / 3" ></ds-image><ds-text literal strong>A week away</ds-text><ds-text literal size="small" wrap>€2,400 of €3,000 saved</ds-text><ds-progress value="0.8" label="80% of the savings goal"></ds-progress></div></div>
<div slot="header" class="example-between"><ds-text literal strong>Overview</ds-text><div class="example-actions"><ds-tag>Demo data</ds-tag><ds-button id="month" secondary>October</ds-button></div></div>
<div class="example-stack">
<div class="example-stats"><ds-stat id="balance-stat" label="Available balance" value="18420" format="money" currency="EUR" whole caption="Across two accounts" literal></ds-stat><ds-stat id="income-stat" label="Money in" value="6200" format="money" currency="EUR" whole caption="2 client payments" literal></ds-stat><ds-stat id="spent-stat" label="Money out" value="408.8" format="money" currency="EUR" caption="3 transactions" literal></ds-stat></div>
<section class="example-cash example-rule"><div class="example-stack"><div class="example-between"><ds-text literal strong>Balance through the month</ds-text><ds-text literal size="small" tone="muted" id="chart-period">1–19 October</ds-text></div><ds-chart id="cash-chart" kind="area" rows="10" color="--one-sharp" labels aria-label="Daily available balance"></ds-chart><div class="example-caption"><ds-text literal size="small" tone="muted" id="chart-start">1 Oct</ds-text><ds-text literal size="small" tone="muted" id="chart-end">19 Oct</ds-text></div></div><div class="example-stack"><ds-text literal strong>Where it went</ds-text><div class="example-tight"><div class="example-caption"><ds-text literal size="small">Production</ds-text><ds-text literal size="small" id="production-spent">€280</ds-text></div><ds-progress id="production-ratio" value="0.685" label="Production spending"></ds-progress><div class="example-caption"><ds-text literal size="small">Travel</ds-text><ds-text literal size="small" id="travel-spent">€86</ds-text></div><ds-progress id="travel-ratio" value="0.21" label="Travel spending"></ds-progress><div class="example-caption"><ds-text literal size="small">Groceries</ds-text><ds-text literal size="small" id="groceries-spent">€42.80</ds-text></div><ds-progress id="groceries-ratio" value="0.105" label="Grocery spending"></ds-progress></div><ds-text literal size="small" tone="muted" wrap>Every outgoing payment, in one place.</ds-text></div></section>
<section class="example-stack example-rule"><div class="example-between"><ds-text literal size="display" strong wrap role="heading" aria-level="2">Recent activity</ds-text><ds-input id="transaction-search" type="search" label="Find a transaction" placeholder="Find a transaction"></ds-input></div><div class="example-actions" role="group" aria-label="Transaction type"><ds-button control="host" active data-filter="all" aria-pressed="true">All</ds-button><ds-button control="host" data-filter="income" aria-pressed="false">Money in</ds-button><ds-button control="host" data-filter="expense" aria-pressed="false">Money out</ds-button></div><div class="example-overflow"><ds-table id="transactions" label="Transactions" sticky></ds-table></div><ds-text id="transaction-count" literal role="status" tone="muted" size="small"></ds-text></section>
<section class="example-goal example-rule"><ds-image src="/examples/images/lake.jpg" alt="Mountains reflected in a still lake" ratio="4 / 3" ></ds-image><div class="example-tight"><ds-text literal strong wrap>A little closer to the mountains.</ds-text><ds-text literal wrap tone="muted">Your next €600 completes the travel fund.</ds-text><ds-progress value="0.8" label="Travel fund: €2,400 of €3,000"></ds-progress></div></section>
</div><div slot="footer" class="example-footer"><ds-text literal size="small" tone="muted" wrap>Fictional demo. Your changes stay here.</ds-text></div></ds-page> const nav = document.querySelector('#finance-nav'); let account='all', filter='all', september=false;
const entries=[{date:'19 Oct',name:'North studio',category:'Client payment',amount:3200,account:'business'},{date:'18 Oct',name:'Corner market',category:'Groceries',amount:-42.80,account:'personal'},{date:'17 Oct',name:'Rail ticket',category:'Travel',amount:-86,account:'personal'},{date:'16 Oct',name:'Print workshop',category:'Production',amount:-280,account:'business'},{date:'15 Oct',name:'Oak house',category:'Client payment',amount:3000,account:'business'}];
const chart=document.querySelector('#cash-chart');
new ResizeObserver(()=>{chart.unit=20*(parseFloat(getComputedStyle(chart).getPropertyValue('--ds-sf'))||1);}).observe(chart);
chart.format=value=>'€'+Math.round(value).toLocaleString('en-IE');
const table=document.querySelector('#transactions'); table.columns=[{key:'date',label:'Date'},{key:'name',label:'Name'},{key:'category',label:'Category'},{key:'amount',label:'Amount',numeric:true}];
function render() {
nav.items=[{id:'all',label:'All accounts',current:account==='all'},{id:'personal',label:'Personal',current:account==='personal'},{id:'business',label:'Business',current:account==='business'}];
const query=document.querySelector('#transaction-search').value.toLowerCase();
table.data=entries.filter(row => (account==='all'||row.account===account)&&(filter==='all'||(filter==='income'?row.amount>0:row.amount<0))&&(row.name+' '+row.category).toLowerCase().includes(query)).map(row=>({...row,date:row.date.replace('Oct',september?'Sep':'Oct'),amount:new Intl.NumberFormat('en-IE',{style:'currency',currency:'EUR'}).format(row.amount*(september?0.8:1))}));
document.querySelector('#transaction-count').textContent=table.data.length+' transactions';
document.querySelector('#month').textContent=september?'September':'October';
const selected=entries.filter(row=>account==='all'||row.account===account);const factor=september?0.8:1;const income=selected.reduce((sum,row)=>sum+Math.max(0,row.amount),0)*factor;const spent=selected.reduce((sum,row)=>sum+Math.max(0,-row.amount),0)*factor;const opening=(account==='personal'?4428.8:account==='business'?8200:12628.8)*factor;
document.querySelector('#income-stat').value=income;document.querySelector('#spent-stat').value=spent;document.querySelector('#balance-stat').value=opening+income-spent;document.querySelector('#balance-stat').caption=account==='all'?'Across two accounts':account==='personal'?'Personal account':'Business account';
document.querySelector('#income-stat').caption=selected.filter(row=>row.amount>0).length+' payments';document.querySelector('#spent-stat').caption=selected.filter(row=>row.amount<0).length+' transactions';
for(const [id,category] of [['production','Production'],['travel','Travel'],['groceries','Groceries']]){const amount=Math.max(0,-selected.filter(row=>row.category===category).reduce((sum,row)=>sum+row.amount,0)*factor);document.querySelector('#'+id+'-spent').textContent=new Intl.NumberFormat('en-IE',{style:'currency',currency:'EUR'}).format(amount);document.querySelector('#'+id+'-ratio').value=spent?amount/spent:0;}
const month=september?'Sep':'Oct';document.querySelector('#chart-period').textContent='1–19 '+(september?'September':'October');document.querySelector('#chart-start').textContent='1 '+month;document.querySelector('#chart-end').textContent='19 '+month;
document.querySelector('#cash-chart').timeRange=[0,18*86400];
document.querySelector('#cash-chart').data=Array.from({length:19},(_,index)=>({time:index*86400,value:opening+selected.filter(row=>Number(row.date.split(' ')[0])<=index+1).reduce((sum,row)=>sum+row.amount,0)*factor}));
}
nav.addEventListener('sidebar-activate', event=>{account=event.detail.id;render();document.querySelector('ds-page').closeDrawer();});
document.querySelector('#month').addEventListener('click',()=>{september=!september;render();});
document.querySelector('#transaction-search').addEventListener('input',render);
document.querySelectorAll('[data-filter]').forEach(button=>button.addEventListener('click',()=>{filter=button.dataset.filter;document.querySelectorAll('[data-filter]').forEach(item=>{item.toggleAttribute('active',item===button);item.setAttribute('aria-pressed',String(item===button));});render();}));
render(); Product showcase
Section titled “Product showcase”A colourful headphone launch, with product details and a working package choice.
<style>
.example-stack { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--ds-unit); min-width:0; align-content:start; }
.example-tight { display:grid; grid-template-columns:minmax(0,1fr); gap:calc(var(--ds-unit) / 2); min-width:0; align-content:start; }
.example-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ds-unit); }
.example-two { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:calc(2 * var(--ds-unit)); align-items:start; }
.example-actions { display:flex; flex-wrap:wrap; align-items:flex-end; gap:calc(var(--ds-unit) / 2); }
.example-between { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end; gap:var(--ds-unit); }
.example-grow { flex:1; min-width:0; }
.example-section { padding-block:var(--ds-unit); }
.example-between > ds-input { width:calc(10 * var(--ds-unit)); max-width:100%; }
.example-overflow { overflow-x:auto; }
.example-rule { border-top:1px solid var(--ds-border-color); padding-top:var(--ds-unit); }
.example-caption { display:flex; justify-content:space-between; gap:var(--ds-unit); }
.example-caption > * { min-width:0; }
.example-nav { display:flex; justify-content:space-between; align-items:flex-end; gap:var(--ds-unit); }
.example-brand { flex:none; }
.example-footer { padding-top:var(--ds-unit); }
.example-stack [hidden], .example-grid [hidden], .example-two [hidden], .example-tight [hidden] { display:none!important; }
.example-status:empty { display:none; }
.example-title { --ds-sf:calc(2 * var(--sf, 1)); --ds-display-text-size:40px; --ds-typeface-regular:var(--typeface-compressed); }
.example-copy { max-width:calc(24 * var(--ds-unit)); }
.example-shop-hero { display:grid; grid-template-columns:2fr 3fr; gap:var(--ds-unit); align-items:stretch; }
.example-shop-intro { display:flex; flex-direction:column; justify-content:space-between; gap:calc(2 * var(--ds-unit)); padding-block:var(--ds-unit); }
.example-shop-hero ds-image { align-self:start; }
.example-story { display:grid; grid-template-columns:1fr 2fr; gap:calc(2 * var(--ds-unit)); padding-block:calc(2 * var(--ds-unit)); }
.example-product { display:grid; gap:calc(var(--ds-unit) / 2); min-width:0; }
.example-bag { padding-block:var(--ds-unit); border-block:1px solid var(--ds-border-color); }
.example-workspace { --ds-page-nav:calc(8 * var(--ds-unit)); --ds-page-gap:calc(2 * var(--ds-unit)); }
.example-workspace-nav { display:grid; gap:calc(2 * var(--ds-unit)); }
.example-week { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:calc(var(--ds-unit) / 2); }
.example-day { display:grid; gap:calc(var(--ds-unit) / 2); min-height:calc(4 * var(--ds-unit)); padding-block:calc(var(--ds-unit) / 2); border-top:1px solid var(--ds-border-color); }
.example-day[aria-current] { border-top-color:var(--ds-text-color); }
.example-work { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:calc(2 * var(--ds-unit)); }
.example-brief { display:grid; gap:calc(var(--ds-unit) / 2); }
.example-contact-sheet { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:calc(var(--ds-unit) / 2); }
.example-contact-sheet > :first-child { grid-column:1 / -1; }
.example-item { box-sizing:border-box; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:calc(var(--ds-unit) / 2); min-height:var(--ds-unit); align-items:end; border-bottom:1px solid var(--ds-border-color); }
.example-item label { display:flex; align-items:flex-end; gap:calc(var(--ds-unit) / 2); min-width:0; }
.example-item label ds-text { flex:1; }
.example-item-meta { display:flex; align-items:flex-end; gap:calc(var(--ds-unit) / 2); }
#balance-stat { --ds-stat-size:40px; --ds-stat-lines:3; --ds-stat-typeface:var(--typeface-compressed); }
.example-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ds-unit); }
.example-cash { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,1fr); gap:calc(2 * var(--ds-unit)); }
.example-goal { display:grid; grid-template-columns:calc(6 * var(--ds-unit)) minmax(0,1fr); gap:var(--ds-unit); align-items:center; }
.example-audio-hero { display:grid; grid-template-columns:1fr 1fr; gap:var(--ds-unit); }
.example-audio-copy { display:flex; flex-direction:column; justify-content:space-between; gap:var(--ds-unit); padding:var(--ds-unit); background:var(--one-pink-pastel); }
.example-audio-copy .example-title { --ds-typeface-regular:var(--typeface-regular); }
.example-audio-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--ds-unit); padding-block:var(--ds-unit); }
.example-audio-detail { display:grid; grid-template-columns:1fr 1fr; gap:calc(2 * var(--ds-unit)); align-items:center; }
.example-package { display:grid; grid-template-columns:1fr 1fr; gap:calc(2 * var(--ds-unit)); padding-block:calc(2 * var(--ds-unit)); }
.example-specs { display:grid; gap:0; }
.example-specs > div { display:flex; justify-content:space-between; gap:var(--ds-unit); border-bottom:1px solid var(--ds-border-color); padding-block:calc(var(--ds-unit) / 2); }
@media(max-width:900px) { .example-title { --ds-sf:var(--sf, 1); } .example-work { grid-template-columns:1fr; } .example-brief { grid-template-columns:1fr 1fr; gap:var(--ds-unit); } .example-cash { grid-template-columns:minmax(0,1fr); } }
@media(max-width:600px) {
.example-title { --ds-sf:var(--sf, 1); --ds-display-text-size:30px; }
.example-shop-hero,.example-audio-hero,.example-audio-detail,.example-package,.example-two,.example-story,.example-brief { grid-template-columns:1fr; gap:var(--ds-unit); }
.example-shop-intro { padding-block:0; gap:var(--ds-unit); }
.example-shop-hero { --hero-ratio:4 / 3; }
.example-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--ds-unit) calc(var(--ds-unit) / 2); }
.example-grid > :first-child { grid-column:1 / -1; }
.example-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
.example-stats > :first-child { grid-column:1 / -1; }
.example-audio-strip { grid-template-columns:1fr; }
.example-week { gap:calc(var(--ds-unit) / 2); }
.example-day { min-height:calc(3 * var(--ds-unit)); }
.example-day ds-text[size=small] { display:none; }
.example-nav .example-nav-secondary { display:none; }
.example-goal { grid-template-columns:calc(4 * var(--ds-unit)) minmax(0,1fr); }
.example-item { grid-template-columns:1fr; }
.example-item-meta { padding-inline-start:calc(1.5 * var(--ds-unit)); }
.example-package { padding-block:var(--ds-unit); }
}
</style><ds-page layout="column" measure="52" data-ds-surface>
<div slot="header" class="example-nav"><ds-text literal strong class="example-brand">Sound / 01</ds-text><div class="example-actions"><ds-button href="#details" class="example-nav-secondary">A closer look</ds-button><ds-button href="#configure" secondary>Choose yours</ds-button></div></div>
<div class="example-stack">
<section class="example-audio-hero"><div class="example-audio-copy"><div class="example-tight"><ds-text literal size="small">For the love of listening.</ds-text><ds-text literal size="display" class="example-title" wrap role="heading" aria-level="1">Press play.<br>Stay a while.</ds-text></div><div class="example-stack"><div data-ds-prose><p>One good pair. Your whole record collection. Meet Sound / 01.</p></div><div><ds-button primary href="#configure">Make it yours · €249 <ds-icon type="right" aria-hidden="true"></ds-icon></ds-button></div></div></div><ds-image src="/examples/images/headphones.jpg" alt="Mint headphones resting across pink and blue paper" ratio="1" loading="eager" position="50% 50%"></ds-image></section>
<div class="example-audio-strip"><ds-stat figure="Wired" label="Just plug in" caption="No pairing. No battery." literal></ds-stat><ds-stat figure="Over-ear" label="Settle into the sound" caption="Soft, full-size cushions" literal></ds-stat><ds-stat figure="Ice blue" label="A little colour" caption="An everyday favourite" literal></ds-stat></div>
<section id="details" class="example-audio-detail example-rule"><ds-image src="/examples/images/headphones.jpg" alt="A closer view of the headphone cushions and cable" ratio="1" position="50% 60%"></ds-image><div class="example-stack"><ds-text literal size="display" strong wrap role="heading" aria-level="2">Nothing between you and the next track.</ds-text><div data-ds-prose><p>Albums deserve more than background noise. Put the phone down, find the comfortable chair and listen all the way through.</p></div><div class="example-specs"><div><ds-text literal tone="muted">Connection</ds-text><ds-text literal >3.5 mm cable</ds-text></div><div><ds-text literal tone="muted">Fit</ds-text><ds-text literal >Over-ear</ds-text></div><div><ds-text literal tone="muted">Finish</ds-text><ds-text literal >Ice blue</ds-text></div></div></div></section>
<section id="configure" class="example-package example-rule"><div class="example-stack"><ds-text literal size="display" strong wrap role="heading" aria-level="2">Your next favourite pair.</ds-text><div data-ds-prose><p>Keep it simple, or take a little extra protection for the journey.</p></div><ds-text literal size="small" tone="muted" wrap>This is a fictional product. No purchase is made.</ds-text></div><div class="example-stack"><div class="example-between"><ds-stat value="249" format="money" currency="EUR" whole label="Your selection" literal></ds-stat><ds-tag>Ice blue</ds-tag></div><div class="example-actions" role="group" aria-label="Choose package"><ds-button control="host" active data-package="Headphones" aria-pressed="true">Headphones</ds-button><ds-button control="host" data-package="Headphones + travel case" aria-pressed="false">With travel case</ds-button></div><ds-text literal id="package-description" wrap tone="muted">Headphones, cable and the next album on your list.</ds-text><div><ds-button primary id="configure-add"><ds-icon type="plus" aria-hidden="true"></ds-icon> Add to bag</ds-button></div><ds-text literal id="product-status" class="example-status" role="status" wrap></ds-text></div></section>
</div><div slot="footer" class="example-footer"><ds-text literal size="small" tone="muted" wrap>Fictional demo. Your changes stay here.</ds-text></div></ds-page> let selection='Headphones';
document.querySelectorAll('[data-package]').forEach(button=>button.addEventListener('click',()=>{selection=button.dataset.package;document.querySelectorAll('[data-package]').forEach(item=>{item.toggleAttribute('active',item===button);item.setAttribute('aria-pressed',String(item===button));});document.querySelector('#configure ds-stat').value=selection==='Headphones'?249:279;document.querySelector('#package-description').textContent=selection==='Headphones'?'Headphones, cable and the next album on your list.':'Headphones, cable and a protective travel case.';document.querySelector('#product-status').textContent='';}));
document.querySelector('#configure-add').addEventListener('click',()=>{document.querySelector('#product-status').textContent=selection+' added to this example bag. No payment is taken.';});