Page chrome
Page chrome is the frame a demo draws around its content: the skip link, the strip across the top that says whose demo it is, and the footer. It puts the same links in the same places on every demo built with the design kit.
The frame around this page is the kit’s own. Each state of the strip and the footer is shown as a picture in both themes, since a second working strip would give this page two portfolio menus. The bands a landing page runs in inside the frame are on the Layouts page. To try the real ones in the other theme, choose Light or Dark next to Theme, at the top of the page.
Skip link
The skip link is the first thing the keyboard reaches, out of sight until then. Reload this page and press Tab, or Option Tab in Safari, to see it. Pressing Enter on it takes you past the strip and the site’s own links, straight to the page’s main content.
It leads to the element whose id it names, main-content unless target names a different id, and that element takes tabindex="-1" so it can take focus.
The code, The skip link and the main content it leads to
<a class="dk-skip" href="#main-content">Skip to content</a>
<main id="main-content" tabindex="-1">...</main><>
<SkipLink />
<main id="main-content" tabIndex={-1}>
...
</main>
</>What the tests check for Skip link
These are the design kit’s own tests for this part, by the file each is in. They come from the source on GitHub as it was when this page was built, so they can be newer than the version named in the footer. Each file name opens that file as it was then.
src/react.test.tsx, without a browsere2e/chrome.spec.tsx, in a browsere2e/explainer.spec.tsx, in a browser
Strip
The strip on a demo's page
The code behind it:
class="dk-strip"withdk-strip-linksLightDark, a picture
LightDark, a picture
The code, The strip on a demo's page
Markup, The strip on a demo's page<div class="dk-strip"> <nav class="dk-strip-links" aria-label="Portfolio"> <a href="https://jasonsdevspace.com/">Jason Poteet</a> <a href="./about/">How it works</a> <a href="https://github.com/jasonsdevspace/example">Source on GitHub</a> </nav> </div>React, The strip on a demo's page<PortfolioStrip about="./about/" source="https://github.com/jasonsdevspace/example" />The strip with a demo's switches
The code behind it:
aria-label="Settings"withdk-strip dk-strip-links dk-strip-tools dk-theme-switch dk-theme-switch-name dk-theme-switch-button dk-theme-switch-choices dk-theme-switch-choice dk-visually-hidden dk-theme-switch-noscriptLightDark, a picture
ThemeYour choice is saved for every page of this site.LightDark, a picture
ThemeYour choice is saved for every page of this site.The code, The strip with a demo's switches
Markup, The strip with a demo's switches<div class="dk-strip"> <nav class="dk-strip-links" aria-label="Portfolio"> <a href="https://jasonsdevspace.com/">Jason Poteet</a> <a href="./about/">How it works</a> <a href="https://github.com/jasonsdevspace/example">Source on GitHub</a> </nav> <section class="dk-strip-tools" aria-label="Settings"> <div class="dk-theme-switch" hidden=""> <span class="dk-theme-switch-name" id="theme-name">Theme</span> <button type="button" class="dk-theme-switch-button" id="theme-button" aria-labelledby="theme-name theme-button" aria-expanded="false" aria-controls="theme-choices" > System </button> <div class="dk-theme-switch-choices" id="theme-choices" role="radiogroup" aria-labelledby="theme-name" aria-describedby="theme-note" > <label class="dk-theme-switch-choice"> <input type="radio" name="theme" value="system" /> <span>System</span> </label> <label class="dk-theme-switch-choice"> <input type="radio" name="theme" value="light" /> <span>Light</span> </label> <label class="dk-theme-switch-choice"> <input type="radio" name="theme" value="dark" /> <span>Dark</span> </label> </div> <span class="dk-visually-hidden" id="theme-note"> Your choice is saved for every page of this site. </span> </div> <noscript> <p class="dk-theme-switch-noscript">With scripts on, a Theme switch sits here.</p> </noscript> </section> </div>React, The strip with a demo's switchesimport { useEffect, useRef } from 'react'; import { attachThemeSwitch } from '@jasonsdevspace/design-kit/controls'; import { PortfolioStrip, ThemeSwitch } from '@jasonsdevspace/design-kit/react'; export const Strip = () => { const theme = useRef<HTMLDivElement>(null); useEffect(() => (theme.current ? attachThemeSwitch(theme.current) : undefined), []); return ( <PortfolioStrip about="./about/" source="https://github.com/jasonsdevspace/example" tools={<ThemeSwitch id="theme" name="theme" ref={theme} />} toolsLabel="Settings" /> ); };The strip keeping room for switches that load later
The code behind it:
class="dk-strip-room"withdk-strip dk-strip-links dk-strip-tools dk-strip-noscriptLightDark, a picture
LightDark, a picture
The code, The strip keeping room for switches that load later
Markup, The strip keeping room for switches that load later<div class="dk-strip"> <nav class="dk-strip-links" aria-label="Portfolio"> <a href="https://jasonsdevspace.com/">Jason Poteet</a> <a href="./about/">How it works</a> <a href="https://github.com/jasonsdevspace/example">Source on GitHub</a> </nav> <section class="dk-strip-tools"> <span class="dk-strip-room"></span> <noscript> <p class="dk-strip-noscript">With scripts on, the demo's switches sit here.</p> </noscript> </section> </div>React, The strip keeping room for switches that load later<PortfolioStrip about="./about/" source="https://github.com/jasonsdevspace/example" toolsWaiting />The strip on a demo's explainer
The code behind it:
aria-current="page"withdk-strip dk-strip-linksLightDark, a picture
LightDark, a picture
The code, The strip on a demo's explainer
Markup, The strip on a demo's explainer<div class="dk-strip"> <nav class="dk-strip-links" aria-label="Portfolio"> <a href="https://jasonsdevspace.com/">Jason Poteet</a> <a href="./about/" aria-current="page">How it works</a> <a href="https://github.com/jasonsdevspace/example">Source on GitHub</a> </nav> </div>React, The strip on a demo's explainer<PortfolioStrip about="./about/" source="https://github.com/jasonsdevspace/example" current="about" />
What the tests check for Strip
These are the design kit’s own tests for this part, by the file each is in. They come from the source on GitHub as it was when this page was built, so they can be newer than the version named in the footer. Each file name opens that file as it was then.
src/react.test.tsx, without a browsere2e/chrome.spec.tsx, in a browsere2e/explainer.spec.tsx, in a browser
Site header
A site's header on a wide screen, its current page marked
The code behind it:
class="dk-site-header"withdk-site-brand dk-site-mark dk-pills dk-pillLightDark, a picture
Scorekeeper LightDark, a picture
Scorekeeper The code, A site's header on a wide screen, its current page marked
Markup, A site's header on a wide screen, its current page marked<header class="dk-site-header"> <a class="dk-site-brand" href="/"> <svg class="dk-site-mark" aria-hidden="true" focusable="false" viewBox="0 0 32 32"> <rect width="32" height="32" rx="8" fill="currentColor"></rect> </svg> Scorekeeper </a> <nav aria-label="Site"> <ul class="dk-pills" role="list"> <li><a class="dk-pill" href="/" aria-current="page">Home</a></li> <li><a class="dk-pill" href="/about/">About</a></li> <li><a class="dk-pill" href="/app/">Open the app</a></li> </ul> </nav> </header>A site's header on a phone, its pages under its name
The code behind it:
class="dk-site-header"withdk-site-brand dk-site-mark dk-pills dk-pillLightDark, a picture
Scorekeeper LightDark, a picture
Scorekeeper The code, A site's header on a phone, its pages under its name
Markup, A site's header on a phone, its pages under its name<header class="dk-site-header"> <a class="dk-site-brand" href="/"> <svg class="dk-site-mark" aria-hidden="true" focusable="false" viewBox="0 0 32 32"> <rect width="32" height="32" rx="8" fill="currentColor"></rect> </svg> Scorekeeper </a> <nav aria-label="Site"> <ul class="dk-pills" role="list"> <li><a class="dk-pill" href="/" aria-current="page">Home</a></li> <li><a class="dk-pill" href="/about/">About</a></li> <li><a class="dk-pill" href="/app/">Open the app</a></li> </ul> </nav> </header>
What the tests check for Site header
These are the design kit’s own tests for this part, by the file each is in. They come from the source on GitHub as it was when this page was built, so they can be newer than the version named in the footer. Each file name opens that file as it was then.
e2e/chrome.spec.tsx, in a browsere2e/pieces.spec.ts, in a browsere2e/links.spec.ts, in a browser
Footer
The footer on a demo's page
The code behind it:
class="dk-footer"LightDark, a picture
LightDark, a picture
The code, The footer on a demo's page
<footer class="dk-footer"> <p> Example is a portfolio project by <a href="https://jasonsdevspace.com/">Jason Poteet</a>, who has <a href="https://github.com/jasonsdevspace">more work</a> on GitHub. <a href="./about/">How it works</a> is explained in plain words. The <a href="https://github.com/jasonsdevspace/example">source</a> is on GitHub under the <a href="https://github.com/jasonsdevspace/example/blob/main/LICENSE">MIT license</a>. </p> </footer><DemoFooter name="Example" about="./about/" source="https://github.com/jasonsdevspace/example" />The footer with a line of the demo's own
The code behind it:
class="dk-footer-aside"withdk-footerLightDark, a picture
LightDark, a picture
The code, The footer with a line of the demo's own
<footer class="dk-footer"> <p> Example is a portfolio project by <a href="https://jasonsdevspace.com/">Jason Poteet</a>, who has <a href="https://github.com/jasonsdevspace">more work</a> on GitHub. <a href="./about/">How it works</a> is explained in plain words. The <a href="https://github.com/jasonsdevspace/example">source</a> is on GitHub under the <a href="https://github.com/jasonsdevspace/example/blob/main/LICENSE">MIT license</a>. </p> <p class="dk-footer-aside">Built at commit abc1234.</p> </footer><DemoFooter name="Example" about="./about/" source="https://github.com/jasonsdevspace/example" aside="Built at commit abc1234." />The footer on a demo's explainer
The code behind it:
aria-current="page"withdk-footerLightDark, a picture
LightDark, a picture
The code, The footer on a demo's explainer
<footer class="dk-footer"> <p> Example is a portfolio project by <a href="https://jasonsdevspace.com/">Jason Poteet</a>, who has <a href="https://github.com/jasonsdevspace">more work</a> on GitHub. <a href="./about/" aria-current="page">How it works</a> is explained in plain words. The <a href="https://github.com/jasonsdevspace/example">source</a> is on GitHub under the <a href="https://github.com/jasonsdevspace/example/blob/main/LICENSE">MIT license</a>. </p> </footer><DemoFooter name="Example" about="./about/" source="https://github.com/jasonsdevspace/example" current="about" />
What the tests check for Footer
These are the design kit’s own tests for this part, by the file each is in. They come from the source on GitHub as it was when this page was built, so they can be newer than the version named in the footer. Each file name opens that file as it was then.
src/react.test.tsx, without a browsere2e/chrome.spec.tsx, in a browsere2e/explainer.spec.tsx, in a browser