🇩🇪 DE

GlassKit Elements

Complete reference for all 46 web components – built by Jungherz GmbH. Vanilla JS, Shadow DOM, native form participation.

v1.40.0 Shadow DOM 46 Components Vanilla JS

Installation

CDN (quickest)

<!-- 1. GlassKit CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/glasskit@1.40/glasskit.min.css"> <!-- 2. GlassKit Elements --> <script src="https://cdn.jsdelivr.net/npm/@jungherz-de/glasskit-elements/dist/glasskit-elements.min.js"></script>

npm

npm install @jungherz-de/glasskit-elements @jungherz-de/glasskit
import '@jungherz-de/glasskit/glasskit.css'; import '@jungherz-de/glasskit-elements';

Selective Import

Import only what you need for smaller bundles:

import '@jungherz-de/glasskit-elements/components/glk-button.js'; import '@jungherz-de/glasskit-elements/components/glk-toggle.js';

Theming

Set data-theme on the <html> element. All components sync automatically via a shared MutationObserver.

<html data-theme="dark"> <!-- or "light" --> <script> // Toggle theme const theme = document.documentElement.getAttribute('data-theme'); document.documentElement.setAttribute('data-theme', theme === 'dark' ? 'light' : 'dark'); </script>

Token defaults and color-scheme. The elements put GlassKit’s token defaults on the document once, in @layer glasskit-defaults, so any stylesheet of yours wins over them. Since 1.20.0 that layer carries the --gl-* tokens only. color-scheme stays off the page: each element sets it on its own theme wrapper, so a select’s list, a date picker or a scrollbar inside an element matches its theme while the page keeps its own. Before, importing the elements switched the whole page to color-scheme: dark — text without a colour of its own turned white, links light blue, native controls dark.

The token names stay global, so a component of yours that reads var(--gl-…, fallback) gets GlassKit’s value. A page that declares the tokens itself, or wants them on part of the page only, switches the defaults off — the attribute is watched, so it may also come or go later:

<html data-glk-defaults="off">

The elements then take the tokens from wherever they inherit them: glasskit.css, or a block of your own on a container around them.

Focus marks

Since GlassKit 1.40.0 every element shows where the keyboard is, in one solid colour: --gl-focus-ring. <glk-button>, <glk-pill> and the actions of <glk-modal> draw it as an outline; they had no mark at all, and a rule of the page could not reach them in their shadow roots. The other elements take the ring, 2 px wide and no longer a tint. GlassKit’s orange reads 3:1 or more on the page and on glass. Press Tab through these:

Primary Secondary

The colour follows the brand. What lies behind the glass decides how bright it gets, and a darker brand can fall short on the brightest spot, glass on a glow card in the middle of the page in dark mode. One of your own goes into the token, solid; measure it there.

/* Your own, in both themes */ :root, [data-theme="dark"] { --gl-focus-ring: #66afff; } [data-theme="light"] { --gl-focus-ring: #0055cc; }

A project that set --gl-border-focus or --gl-shadow-focus itself keeps its own ring until it drops them. In forced colors, Windows’ high contrast mode, the browser drops box-shadow, and every element shows an outline in the text colour.

Density

For admin screens, desktop layouts and narrow forms, data-density="compact" on the <html> element makes every control denser: fields and buttons 40px high instead of 52 and 56, smaller toggles, checkboxes and radios, denser list rows and modal actions. The sizes are GlassKit's density tokens (GlassKit 1.21.0), so they reach every shadow root by inheritance — a project's own values too; with data-glk-defaults="off" the preset comes from glasskit.css on the page, like every other token. The same observer mirrors the attribute onto each element's theme wrapper, so switching at runtime needs nothing else.

<html data-theme="dark" data-density="compact"> <script> // Back to the default density document.documentElement.removeAttribute('data-density'); </script>

Solid and tint surfaces

Not every screen wants glass. data-surface="solid" on the <html> element makes every surface opaque and turns blur and gloss off — cards, fields, buttons, lists, sheets — each in the colour the glass shows over the theme’s middle background. It is GlassKit’s solid surface preset (GlassKit 1.24.0): tokens only, so it reaches every shadow root by inheritance, and a project’s own values do too; with data-glk-defaults="off" it comes from glasskit.css on the page. Since 1.24.0 the observer mirrors this attribute onto each element’s theme wrapper as well, so a rule keyed on it matches inside the shadow roots.

<html data-theme="dark" data-surface="solid">

On a page with a background of its own — a brand colour, a photo — data-surface="tint" (GlassKit 1.25.0) makes the surfaces in the flow see-through tints of the text colour instead, nothing blurred. What lies over other content keeps the solid values, inside the shadow roots too: the panels of <glk-modal>, <glk-sheet>, <glk-popover>, <glk-toast> and the tab bars, with the fields inside them, and the secondary button. The wrapper mirrors this value like any other.

Primary as text

GlassKit 1.26.0 gives the primary a second token: --gl-color-primary fills, --gl-color-primary-text colours text and line icons on the page or the glass. In the elements that is the icon and label of the active <glk-tab-item>, <glk-list-item variant="accent">, the value of <glk-range>, the primary action of <glk-modal>, and the trigger under the pointer and the chevron of an open <glk-accordion-item>. It defaults to the primary. A brand that darkens its primary for white button text lightens the text in its dark theme, and the buttons keep their colour; the token reaches every shadow root by inheritance. Write the light rule after the dark one, because :root matches a page in the light theme too:

:root, [data-theme='dark'] { --gl-color-primary-text: color-mix(in srgb, var(--gl-color-primary) 18%, #ffffff); } [data-theme='light'] { --gl-color-primary-text: var(--gl-color-primary); }

--gl-tab-bar-active-color colours the icon and label of the active tab alone, for a spotlight that needs a lighter tone still; unset, they take --gl-color-primary-text.

Accent fills

White text on GlassKit’s orange reads 2.0 to 3.8:1 where the accent fills a surface: the primary <glk-button>, the chosen day of <glk-calendar> and <glk-date-strip>, the number of the current step in <glk-steps>. GlassKit 1.32.0 gives these fills tokens of their own, unset by default, so nothing changes until a project sets them: --gl-btn-primary-bg replaces the whole background of the primary button (today’s gradient when unset), --gl-color-primary-fill fills the chosen days and the current step (the primary when unset). A brand that keeps white text darkens the fills and leaves its primary alone — the primary also draws focus rings, borders and the accent as text. The tokens reach every shadow root by inheritance; with these values white reads 5:1 or more on every fill, in both themes:

:root, [data-theme='dark'] { --gl-color-primary-fill: color-mix(in srgb, var(--gl-color-primary) 60%, #000); --gl-btn-primary-bg: linear-gradient(135deg, var(--gl-color-primary-fill), color-mix(in srgb, var(--gl-color-primary-dark) 60%, #000)); } [data-theme='light'] { --gl-color-primary-fill: color-mix(in srgb, var(--gl-color-primary) 70%, #000); --gl-btn-primary-bg: linear-gradient(135deg, var(--gl-color-primary-fill), color-mix(in srgb, var(--gl-color-primary-dark) 70%, #000)); }

A brand that turns to a dark ink instead sets --gl-color-on-primary. Since GlassKit 1.32.0 the dot of <glk-radio> follows it as the checkbox tick does; before, it stayed white on the same orange.

Printing

Print dialogs leave out background graphics by default. With GlassKit 1.21.1 the parts that carry a state keep their colours on paper — checkbox, radio, toggle, progress, the current step, the chosen day, the slider thumb, the tone dots — inside the elements as well. A dark page prints its light text and surfaces on white paper; a page meant for printing switches to the light theme for it, and the elements follow:

let printTheme = null; addEventListener('beforeprint', () => { printTheme = document.documentElement.getAttribute('data-theme'); document.documentElement.setAttribute('data-theme', 'light'); }); addEventListener('afterprint', () => { if (printTheme) document.documentElement.setAttribute('data-theme', printTheme); else document.documentElement.removeAttribute('data-theme'); });

Form Integration

All form components participate in native forms via ElementInternals: their value goes into FormData, and a reset restores it. Since 1.20.0 the form also learns whether they are valid. The inner field checks required, pattern, min, type="email" and the like, and the element reports its verdict: form.checkValidity() is false while a required field is empty, a submit stops at the first invalid field with the browser’s own message, reportValidity() focuses it, and validity, validationMessage and willValidate answer on the element. <glk-button type="submit"> submits its form and type="reset" resets it — before 1.20.0 both did nothing.

Labels are tied to their fields: a screen reader names the field by its label, and a click on the label text focuses it — as do element.focus() and a click on a <label for> that names the element. The hint of <glk-input> is read as the field’s description.

Disabled (since 1.22.3): every form element follows its own disabled and a <fieldset disabled> around it, as native controls do — dimmed, out of the tab order, no input, a submit button sends nothing, and FormData leaves it out. Before, a fieldset reached only the form data: the fields inside stayed usable, and a submit button sent the form empty. The disabled property reflects the attribute, as on a native control.

<form id="settings"> <glk-input name="username" label="Username"></glk-input> <glk-toggle name="notify" label="Notifications" checked></glk-toggle> <glk-button variant="primary" type="submit">Save</glk-button> </form> <script> document.getElementById('settings').addEventListener('submit', (e) => { e.preventDefault(); const data = new FormData(e.target); console.log(Object.fromEntries(data)); // { username: "...", notify: "on" } }); </script>

Content Components

<glk-title>

Styled heading with text shadow.

Page Heading
<glk-title>Page Heading</glk-title>

<glk-badge>

Inline status badge with color variants — and, with interactive, a filter chip.

Default Primary Success Warning Error
<glk-badge variant="success">Active</glk-badge>

interactive renders the badge as a real <button> — pointer cursor, hover tint, focus ring, keyboard operable — and makes it emit glk-click. selected marks the chip that is on and is mirrored to aria-pressed. Try the row: it moves selected on glk-click.

Active Applied Paused Done Pending
<glk-badge interactive selected>Active</glk-badge> <glk-badge interactive>Applied</glk-badge>
AttributeTypeValues
variantStringprimary | success | warning (since 1.18.0) | error
interactiveBooleanPressable chip; enables glk-click
selectedBooleanThe chip that is on — deepens the badge's own color, sets aria-pressed
sizeStringsm (default) | md: a chip to choose with, 36 px high; property size (since 1.33.0)

Events: glk-click when interactive is set. Part: badge — the <span>, or the <button> with interactive (since 1.33.0).

Choice chips (since 1.33.0). A badge is 25 to 26 px high, right for a status or a filter above a list. A chip that answers a question in a form — one sector of several in a sign-up, say — takes size="md": 36 px high, in the small text of a form, its label centred. Interactive, it takes taps on 44 px, 4 px above and below its edges, the target every control keeps. GlassKit’s .glass-badge--md draws it; --gl-badge-md-height sets another height. Try the row:

Café & bakery Restaurant Retail Services
<glk-badge interactive selected size="md">Café &amp; bakery</glk-badge> <glk-badge interactive size="md">Restaurant</glk-badge>

<glk-avatar>

Circular avatar with initials or image.

S MD LG
<glk-avatar size="lg">JD</glk-avatar> <glk-avatar src="photo.jpg"></glk-avatar>
AttributeTypeValues
sizeStringsm (32 px) | (default, also md, 44 px) | lg (56 px)
srcStringImage URL

Since 1.37.0 an avatar in the leading box of a <glk-list-item> takes the box’s size: 40 px with leading-lg, the avatar of a contact list, and 28 px without. A 44 px one was cut by the box, a 32 px one looked lost in it. GlassKit’s --gl-avatar-size sets any other size, on the element or a container around it, and --gl-avatar-font-size the initials’ size with it; on the avatar itself it wins over the box. Parts (since 1.37.0): avatar, the circle, and image, the picture in it.

LH TB
<glk-list-item title="Lena Hoffmann" leading-lg> <glk-avatar slot="leading">LH</glk-avatar> </glk-list-item> .contacts { --gl-avatar-size: 36px; --gl-avatar-font-size: 14px; }

<glk-card>

Glass-effect content card.

Card content here.
<glk-card glow>Highlighted content</glk-card>
AttributeTypeDescription
glowBooleanAdds gradient glow effect
fillBooleanStretches the card to the full height of its grid or flex cell and makes it a flex column, so margin-top: auto pushes a footer down (since 1.8.0). The card yields to its cell: content that cannot wrap, like a nowrap list subtitle, is truncated instead of widening the card (since 1.15.2)

<glk-divider>

<glk-divider></glk-divider>

<glk-status>

Status notice with message. Since 1.35.0 the message may be the element’s content, with markup; message stays the short form for plain text and shows while the content is empty (whitespace does not count). GlassKit’s --gl-status-color sets its colour. Parts (since 1.35.0): status, message. Since 1.36.0 the message has no margin of its own (GlassKit 1.36.0): the browser’s 1em above and below it made the notice 82 px high instead of 54 px.

Included in your package Premium
<glk-status message="No results found"></glk-status>

<glk-empty>

Empty state for lists and result pages: icon plate, title, short text and one action. An empty title or text hides its element.

Book
<glk-empty title="No bookings yet" text="…"> <svg viewBox="0 0 24 24">…</svg> <glk-button slot="action" size="sm">Book</glk-button> </glk-empty>
AttributeTypeValues
titleStringHeading; hidden when empty
textStringMuted text; hidden when empty

Slots: default (an <svg> icon; a plain circle as fallback), action. Parts: empty, icon, title, text, action.

Buttons

<glk-button>

Glass-styled button with three variants and size options.

Primary Secondary Tertiary
<glk-button variant="primary" size="auto">Save</glk-button>
AttributeTypeValues
variantStringprimary | secondary | tertiary
sizeStringsm | md | lg | auto, or a height and auto together: sm auto, a small button as wide as its text (since 1.31.0)
disabledBooleanDisables the button
typeStringbutton | submit | reset — submit and reset act on the element’s form (since 1.20.0)
aria-label, aria-labelledby, aria-describedbyStringName and describe the native button from the host instead of its content (since 1.36.0)

Events: glk-click   Part: button, the native button inside (since 1.31.0)

Since GlassKit 1.31.0 every button keeps room beside its label, 24 px unless --gl-btn-padding-x sets another: a small button that takes its width from its text, in a row or an empty state, touched the text with its edges before. --gl-btn-radius rounds the buttons alone — 9999px for pill-shaped ones — and leaves lists and the segmented control as they are.

type="submit" submits the form the element sits in, type="reset" resets it — once the click has finished bubbling, so a listener that calls preventDefault() on the click stops it, as on a native button. A form with invalid fields does not submit and shows the browser’s message. The submit event names the element as its submitter; .form is its form, and element.click() acts like a click. aria-expanded, aria-haspopup and aria-pressed set on the element are handed on to the native button inside, which is what screen readers read (since 1.20.0). Since 1.36.0 aria-label and aria-labelledby name it too — an icon alone, or “Restore” that should say “Restore Info page 55” —, and aria-describedby describes it. aria-labelledby and aria-describedby point at elements of the page through element reflection, as on <glk-toggle>. Before, they stayed on the element, which has no role, and named nothing.

<glk-button variant="tertiary" aria-label="Close"><svg aria-hidden="true">…</svg></glk-button> <glk-button aria-label="Restore Info page 55">Restore</glk-button>

focus() on the element focuses the button inside, and so does autofocus (since 1.33.2; before, the element could not take the focus from outside). <glk-pill>, <glk-tab-item> and <glk-tab-accessory> do the same. Elements with more than one control hand focus() to the one Tab reaches: <glk-segmented> the chosen option, <glk-calendar> and <glk-date-strip> the day that is the tab stop, <glk-image-picker> its choose button, <glk-accordion-item> its trigger, an interactive or sortable <glk-list-item> its row and an interactive <glk-badge> its button.

<glk-pill>

Small circular icon button (46x46px).

<glk-pill label="Menu"> <svg viewBox="0 0 24 24">...</svg> </glk-pill>
AttributeTypeDescription
labelStringAccessible aria-label
disabledBooleanDisables the button

aria-expanded, aria-haspopup and aria-pressed are handed on to the native button inside (since 1.20.0) — <glk-popover> sets aria-expanded on its trigger.

Form Components

All form components support name, value, disabled and participate in native <form> submission. The browser’s input event reaches the element once per key or step (since 1.36.0; before, <glk-input>, <glk-textarea>, <glk-search> and <glk-range> sent one of their own on top, and a listener on the element got each twice).

<glk-input>

Text input with label, hint, and error state.

EUR
<glk-input label="Email" type="email" placeholder="you@example.com" hint="Required" error name="email"></glk-input>
AttributeTypeDescription
labelStringInput label
typeStringtext, email, password, ...
placeholderStringPlaceholder text
hintStringHelper text, read as the field’s description
errorBooleanError styling; marks the field invalid for screen readers (aria-invalid, since 1.20.0). It does not block the form — a server’s verdict arrives this way
requiredBooleanRequired field; while it is empty the form does not submit (since 1.20.0)
readonlyBooleanRead-only: focusable, selectable and submitted, but not editable; property readOnly (since 1.22.0)
min, max, stepStringPassed to the inner field: range and step of the picker for dates, times and numbers (since 1.17.0)
minlength, maxlength, patternStringPassed to the inner field (since 1.17.0)
autocomplete, inputmodeStringAutofill and on-screen keyboard, passed to the inner field (since 1.17.0)
label-hiddenBooleanThe label stays the field’s name, out of sight (since 1.36.0) — below
aria-label, aria-labelledbyStringName the field from the host instead of its label (since 1.36.0)
counterBooleanThe value’s length at the end of the label row, “12/58” with maxlength (since 1.37.0) — as on <glk-textarea>

Events: glk-input, glk-change

Slots (since 1.22.0): prefix and suffix put an icon, a currency, a unit or a button inside the field’s box, at its start and end — right to left they swap sides. Each shows only while something is slotted into it; its width is measured and the text keeps clear of it. A click on slotted text, an icon or a disabled control goes through to the field; enabled controls, <glk-button> and <glk-select> included, links and elements with tabindex take their own (since 1.22.2 — before, every slotted element took the click). Slot the control itself: one wrapped in a slotted element needs pointer-events: auto from the page. A container locked with pointer-events: none does not hold a control; lock it with inert, or disable the control. Their text is read with the field as its description. The box is the part box, the affixes prefix and suffix.

<glk-input label="Price" inputmode="decimal"> <span slot="suffix">EUR</span> </glk-input>

A place in the label row (since 1.33.0). slot="label-end" puts a link at the end of the label’s line — “Forgot password?” beside “Password”. The place comes after the field in the shadow tree, so the keyboard reaches the link after the field, which reads best in a sign-in form: email, password, “Forgot password?”, then the button. (Safari tabs to links only with Option+Tab, or with its setting for it, as on every page.) It shows only while something is slotted: then label and link share the line, the link at its end, and the field spans the width below. <glk-textarea> and <glk-select> have the same place. GlassKit’s .glass-input-group--label-end draws it. Parts: label on the label, label-end on the place.

<glk-input label="Password" type="password" name="password"> <a slot="label-end" href="/reset">Forgot password?</a> </glk-input> glk-input::part(label) { letter-spacing: 0.01em; }

A name without a visible label (since 1.36.0). Fields in a table under one shared header — opening hours with the columns From and To for each day — each need their label as their name, but showing it in every cell repeats the header. label-hidden keeps label as the field’s name and takes it out of sight, as on the switches; aria-label or aria-labelledby on the element name the field directly. A group around each row names the day. <glk-select> and <glk-textarea> take the same attributes. Since 1.38.0 GlassKit’s --gl-label-hidden: 1 does the same for every field in a container and can be set from a container or media query, where the attribute cannot follow: the labels out of sight while the week is a table, above the fields when it turns into a list. It needs style queries on custom properties: Chrome 111, Safari 18 and Firefox 151. Without them the labels stay above their fields — for older browsers set label-hidden from a script, or put the rules of a visually hidden label on ::part(label) in the same query.

@container week (min-width: 560px) { .day { --gl-label-hidden: 1; } }
DayFromTo
Monday
Tuesday
<div role="group" aria-label="Monday"> <glk-input type="time" label="From" label-hidden></glk-input> <glk-input type="time" label="To" label-hidden></glk-input> </div>

<glk-textarea>

<glk-textarea label="Message" rows="4"></glk-textarea>

Attributes: label, rows, placeholder, required, readonly (since 1.22.0), name, value, disabled. The label names the field. slot="label-end" and the parts label and label-end as on <glk-input> (since 1.33.0). Since 1.36.0 label-hidden, aria-label and aria-labelledby as on <glk-input>. Since 1.37.0 minlength, maxlength, autocomplete and inputmode reach the field, as on <glk-input> — before, a text area took any number of characters —, and counter counts its characters (below).

Events: glk-input { value } on every key; since 1.35.0 glk-change { value } once a value is done — on leaving the field with a changed value, as on <glk-input>, and on Ctrl+Enter or Cmd+Enter, where Enter alone breaks the line. Once for each value: a change reported by the keys is not reported again on leaving. A native change goes out with it.

A character counter (since 1.37.0): counter shows the length of the value at the end of the label row — “48/145” with maxlength, the length alone without —, in GlassKit’s .glass-input-group__counter. Past the limit, as a value set by script may be, it turns to the error colour. It is part of the field’s description, so a screen reader reads it with the field, and it stands after a link in slot="label-end". <glk-input> has it too. Part: counter.

<glk-textarea label="Meta description" maxlength="145" counter></glk-textarea> <glk-input label="Meta title" maxlength="58" counter></glk-input>

<glk-select>

<glk-select label="Plan" name="plan"> <option value="free">Free</option> <option value="pro">Pro</option> </glk-select>

Children: native <option> elements. With required and an empty first option (value="") the form does not submit until a choice is made (since 1.20.0). The label names the field. A value — attribute or property — that names no option yet is kept and selected once its option arrives, until the user picks another (since 1.22.0; before, a value set as a property before the options were copied was lost). A form reset returns to the value attribute. slot="label-end" and the parts label and label-end as on <glk-input> (since 1.33.0). Since 1.36.0 label-hidden, aria-label and aria-labelledby as on <glk-input>.

A placeholder (since 1.37.0): placeholder puts the native pattern in front of the options — an option with an empty value, disabled and hidden — and shows it in GlassKit’s placeholder colour while no value matches an option: a record without a choice yet, value="", a value that names no option. It cannot be picked, required keeps the form from submitting while it shows, and the form gets no value for it, as from a native select. Before, the first option showed as chosen, and picking it changed nothing, so the page could not tell “nothing chosen” from “the first one”. With a placeholder the empty value means “nothing chosen”, unless an option of the page carries it.

<glk-select label="Kind" placeholder="Choose a kind…" value="" required> <option value="facebook">Facebook</option> <option value="instagram">Instagram</option> </glk-select>

<glk-toggle>

Switch toggle with form participation.

<glk-toggle label="Notifications" name="notify" checked></glk-toggle>
AttributeTypeDescription
labelStringToggle label
checkedBooleanChecked state
disabledBooleanDisabled state
requiredBooleanMust be on before the form submits (since 1.20.0)
label-hiddenBooleanThe label stays the switch’s name, out of sight (since 1.33.1)
label-positionStringend (default) or start: the label before the switch (since 1.33.1)
fullBooleanThe control over the whole row, text and switch at its two ends; with label-position="start" the switch at the row’s end, as in the settings of iOS (since 1.39.0)
aria-label, aria-labelledbyStringName the switch from the host instead of its label (since 1.33.1)

Events: glk-change → { checked: boolean } · Parts: track, label (since 1.33.1)

The switch is the native checkbox inside, with role="switch": one control for screen readers, named by label, its state read from the checkbox. Since 1.20.0 the element itself carries no role, aria-checked or aria-disabled — style and select on [checked] and [disabled]. element.click() and a <label> around the element or naming it toggle it, as they do a native checkbox; the same holds for <glk-checkbox> and <glk-radio>. Without label the element is exactly as large as its track, 52 × 30 px.

A name without a visible label (since 1.33.1). In a settings row the title stands on the left and the switch at the end, where its own label would show the title a second time. label-hidden keeps label as the switch’s name and takes it out of sight. aria-label on the element names the switch directly. aria-labelledby points at a title of the page by its id — through element reflection, since an id from the page does not reach into the shadow root, with the title’s text as a fallback name. label-position="start" puts a visible label before the switch. The same attributes work on <glk-checkbox> and <glk-radio>.

<glk-list-item title="Contact form"> <glk-toggle slot="trailing" label="Contact form" label-hidden></glk-toggle> </glk-list-item> <!-- Or point at a title of the page's own --> <span id="news-title">Newsletter</span> <glk-toggle aria-labelledby="news-title"></glk-toggle>

The switch at the row’s end (since 1.39.0). full spreads the control over its row: with label-position="start" the text stands at the row’s start and the switch at its end, as in the settings of iOS, mirrored right to left. GlassKit 1.39.0’s --label-start and --full do the same without the elements. The whole row is the label, so a click anywhere on it switches. <glk-checkbox> and <glk-radio> take the same attributes. In a list row the switch goes into slot="trailing" with label-hidden instead, the row’s title as its name (above).

<glk-toggle label="Notifications" label-position="start" full></glk-toggle>

<glk-checkbox>

<glk-checkbox label="I agree" name="terms" checked></glk-checkbox>

required keeps the form from submitting until the box is ticked (since 1.20.0).

Since 1.33.1 label-hidden, label-position and aria-label / aria-labelledby on the element work as on <glk-toggle>. Parts: box, label.

<glk-radio>

<glk-radio name="plan" label="Free" value="free" checked></glk-radio> <glk-radio name="plan" label="Pro" value="pro"></glk-radio>

required on any radio of a group makes the group required; any checked radio satisfies it, as with native radios (since 1.20.0).

Since 1.33.1 label-hidden, label-position and aria-label / aria-labelledby on the element work as on <glk-toggle>. Parts: circle, label.

<glk-range>

<glk-range label="Volume" min="0" max="100" value="65"></glk-range>
AttributeTypeDescription
minNumberMinimum (default: 0)
maxNumberMaximum (default: 100)
valueNumberCurrent value
stepNumberStep increment

Events: glk-input { value } on every step; since 1.36.0 glk-change { value } once a value is set — when the pointer lets go of the thumb, and on every key, as the native slider’s change: one request instead of one per step of a drag. A native change goes out with it.

<glk-segmented>

A small, exclusive choice as one control. Renders one <button> per option, the chosen one marked aria-pressed="true"; a value change only re-sets that attribute, so focus stays where it was. Form-associated: a surrounding <form> receives name=value, reset restores the initial value. Try it: Tab to a button, press Space. More options than fit: overflow="scroll" keeps one row that scrolls sideways and keeps the chosen option in view, overflow="wrap" breaks it into lines.

waiting for glk-change…
<glk-segmented full label="Status" name="status" value="y" options='[{"value":"g","label":"Green","tone":"success"}, {"value":"y","label":"Yellow","tone":"warning"}, {"value":"x","label":"Locked","disabled":true}]'></glk-segmented>
AttributeTypeValues
optionsJSON[{ value, label, tone?, disabled?, badge?, badgeLabel?, badgeTone? }] — tone: success | warning | error; badge: a count after the label (since 1.29.0); badgeTone: primary | success | warning | error, the count’s own colour (since 1.31.0)
valueStringThe chosen option's value
fullBooleanButtons share the width
overflowStringscroll — one row that scrolls sideways, the chosen option kept in view; wrap — breaks into lines. Without it the row stays one line (since 1.17.0)
labelStringaria-label of the group
nameStringForm field name (form-associated)
disabledBooleanThe whole row (since 1.22.3); a <fieldset disabled> around it disables it too
dropletBooleanThe chosen option sits on a drop of glass that glides to the next one and can be dragged (since 1.27.0)
icon-onlyBooleanThe options show their icons alone, square; each label becomes the button’s aria-label and title (since 1.28.0; property iconOnly)

Events: glk-change { value } — only on a change made by the user. Slots: icon-<value> (since 1.28.0). Parts: group, item (each option) and badge (its count), the last two since 1.31.0.

Droplet (since 1.27.0). droplet gives the chosen option the drop of the tab bar: it runs to a new option, stretches on the way and settles, the text it passes lights up, and a finger can drag it. A drag that ends on an option selects it like a tap — value, glk-change and the form value follow; disabled options are skipped. With overflow="scroll" a swipe still scrolls the row: only the drop itself is dragged, and the row scrolls along at its edges. Recommended wherever a segmented control is used:

<glk-segmented droplet full overflow="scroll" label="Area" value="a" options='[…]'></glk-segmented>

Icons (since 1.28.0). Each option takes an icon from the slot icon-<value> — an <svg>, a font icon such as Material Icons, an <img>. It sits in GlassKit’s .glass-segmented__icon before the label, in the option’s colour, and grows under the drop; an option without one has no icon box. icon-only shows the icons alone, for a light / dark / auto switch: the options become square, and each label becomes the button’s aria-label and title. The icon box is hidden from assistive technology, so a font icon’s text never joins the name.

Coloured logos (since 1.35.0). An SVG icon strokes in the option’s colour, which outlines a coloured logo — the mark of an image source — in the text colour. icon-style="color" keeps the logos’ own fills and strokes for every option, "iconStyle": "color" in an option’s JSON for that one (GlassKit’s .glass-segmented__icon--color). Attributes on the <svg> itself do not help: the slotted rule wins over them in all three engines.

<glk-segmented droplet icon-only label="Theme" value="dark" options='[{"value":"light","label":"Light"}, {"value":"dark","label":"Dark"}, {"value":"auto","label":"Auto"}]'> <svg slot="icon-light" viewBox="0 0 24 24">...</svg> <span slot="icon-dark" class="material-icons">dark_mode</span> <svg slot="icon-auto" viewBox="0 0 24 24">...</svg> </glk-segmented>

Counts (since 1.29.0). badge on an option shows how much waits behind it — open invoices, new tickets — as a small pill after the label, in tabular figures; where the dot only says that something is there, the badge says how much. A number or a short text; missing, empty or 0 shows none. Without a tone the pill is neutral, with one it takes the tone’s colour. The name says it with the label, “Tickets, 1”, and badgeLabel words it, “Tickets, 1 open”. In an icon-only row the badge sits at the icon’s corner, as on <glk-tab-item>, and the button’s title carries it as well. New options with the same values in the same order fill the buttons in place: a count that changes keeps the focus and the drop where they are.

<glk-segmented droplet overflow="scroll" label="Customer" value="invoices" options='[ {"value":"payments","label":"Payments"}, {"value":"invoices","label":"Invoices","badge":2}, {"value":"tickets","label":"Tickets","tone":"warning","badge":1,"badgeLabel":"1 open"}]'></glk-segmented> // A count changed: same values, so the buttons stay segmented.options = segmented.options.map(o => o.value === 'tickets' ? { ...o, badge: 2, badgeLabel: '2 open' } : o);

A colour of the count’s own (since 1.31.0). badgeTone — primary, success, warning or error — colours the count alone, with GlassKit’s .glass-segmented__badge--*: the look of the badge variants, without the dot that tone puts before the label. Where an option has both, the count keeps its own colour. Size and hairline come from GlassKit’s tokens, --gl-segmented-badge-height, -font-size and -border, which reach the element by inheritance; for anything else the count is the part badge and each option the part item.

<glk-segmented droplet label="Calls" value="open" options='[ {"value":"open","label":"Open","badge":4,"badgeTone":"error"}, {"value":"done","label":"Done"}]'></glk-segmented> /* What the tokens do not reach */ glk-segmented::part(badge) { letter-spacing: 0.02em; }

GlassKit’s tokens for the chosen option reach the element by inheritance (GlassKit 1.28.0): --gl-segmented-active-bg, --gl-segmented-active-shadow and --gl-segmented-active-color — for a dark brand on which the light surface leaves a white label below 4.5:1. The drop takes the same surface.

Tooltips per option (since 1.39.0): an icon-only row shows each label in a tooltip — on hover after a moment, at once on keyboard focus, on a long press, as <glk-tooltip> — where it had the browser’s title, which showed neither on focus nor on touch. An option’s hint in options is the tooltip’s second line, GlassKit’s .glass-tooltip__hint, and the button’s description; in a row with labels an option with a hint shows the hint alone. tooltip-placement (top, the default, bottom, start, end) says where they open — bottom for a row in a head. Part: tooltip. Hover or focus an option:

<glk-segmented icon-only tooltip-placement="bottom" options='[{"value":"preview","label":"…","hint":"…"}, …]'>…</glk-segmented>

<glk-calendar>

One month with a day to pick. The days are buttons in a role="group", the chosen one aria-pressed="true", each named with its full date; month title, weekday names and the first day of the week come from Intl for the locale (week-start overrides). One tab stop: arrows move by a day or a week, Home/End to the ends of the week, PageUp/PageDown by a month — moving past the month’s edge shows that month and emits glk-month. Arrows only move focus; Enter or Space picks, so a calendar that opens a sheet on every pick stays quiet while the user looks around. Days outside min/max are aria-disabled: in the arrow path, announced, never picked. Form-associated like <glk-segmented>. Try it: Tab into the grid, use the arrows, press Enter.

waiting for glk-change / glk-month…
<glk-calendar name="day" value="2026-09-22" min="2026-09-22" label="Pick a day" marks='{"2026-09-24":["error"],"2026-09-27":["success","warning"]}'></glk-calendar>
AttributeTypeValues
monthStringShown month YYYY-MM; without it the month of the value, else of today. Reflected when the user navigates; a value set to another month flips to it
valueStringChosen day YYYY-MM-DD
todayStringThe day with the warm border; the browser’s day when missing
min, maxStringDays outside cannot be picked (aria-disabled)
marksJSON{ "2026-09-30": ["error", "warning"] } — up to three tones per day: primary | success | warning | error
localeStringBCP 47 tag for names and week start; without it the page language — the lang of the nearest ancestor, usually <html lang>, also across shadow roots — else the browser language (page language since 1.19.2)
week-startNumber0 = Sunday … 6 = Saturday; from the locale when missing, Monday where the browser cannot say
labelStringaria-label of the day group
prev-label, next-labelStringNames of the nav buttons; “Previous month” / “Next month” by default
nameStringForm field name (form-associated)
disabledBooleanArrows and days (since 1.22.3); a <fieldset disabled> around it disables it too

Events: glk-change { value } on a pick by the user; glk-month { month } when the user moves to another month. Properties: month, value, marks, locale, label, disabled. Parts: calendar, head, title, grid.

<glk-image-picker>

One image with a preview, resized on the client before it goes anywhere. Choose opens the file dialog from a real button; the file is decoded with createImageBitmap, the EXIF rotation of a phone photo applied, drawn onto a canvas no larger than max and handed out as a data URL in glk-change. The src property holds it and is not reflected, so a data URL of megabytes never lands in the DOM. A file the browser cannot decode — Chrome and HEIC, a corrupt file — emits glk-error instead of failing silently. Not form-associated: listen to glk-change and upload. Try it with a photo from your phone.

waiting for glk-change…
<glk-image-picker round max="512" label="Profile photo" hint="JPG, PNG"></glk-image-picker> <script>picker.addEventListener('glk-change', e => upload(e.detail.dataUrl));</script>
AttributeTypeValues
srcStringStarting image: URL or data URL
labelStringVisible label; names the group
hintStringSmall muted line; none by default — what is accepted depends on accept and the browser
roundBooleanCircular preview, for avatars
maxNumberLongest edge in px after resizing, default 1024
type, qualityString, NumberOutput MIME (default image/jpeg; image/webp where the browser encodes it, PNG otherwise) and quality 0–1 (default 0.82)
acceptStringFile dialog filter, default image/*
choose-label, change-label, remove-labelStringButton texts; “Choose”, “Change”, “Remove” by default

Events: glk-change { dataUrl, width, height, size } after a pick, and on remove with an empty dataUrl and zeros; glk-error { message, name } when the file cannot be decoded. Property: src (not reflected). Parts: picker, preview, meta, label, hint, actions.

Navigation

<glk-nav> + <glk-pill>

Horizontal navigation bar with circular icon buttons.

<glk-nav> <glk-pill label="Back"><svg>...</svg></glk-pill> <glk-pill label="Settings"><svg>...</svg></glk-pill> </glk-nav>

<glk-tab-bar> + <glk-tab-item>

Bottom tab bar navigation. The items sit in the middle of the bar; on an iPhone with viewport-fit=cover they keep to the top, above the home indicator (GlassKit 1.28.0). Since 1.32.0 the same items also make a sidebar, an icon rail or a top bar, and since 1.33.0 a rail that keeps its labels, with a place for a mark and the account — see below.

<glk-tab-bar> <glk-tab-item label="Home" active><svg>...</svg></glk-tab-item> <glk-tab-item label="Profile" badge="3"><svg>...</svg></glk-tab-item> </glk-tab-bar>
AttributeComponentDescription
labelglk-tab-itemTab label
activeglk-tab-itemActive state; the item carries aria-current="page" (since 1.32.0)
badgeglk-tab-itemBadge count
badge-labelglk-tab-itemThe count in words for the item’s name: “Customers, 3 new” instead of “Customers, 3” (since 1.32.0)
badge-dotglk-tab-itemA dot without a count — something needs you here; badge-label says why in the item’s name (since 1.38.0, below)
hrefglk-tab-itemThe item is a link, so its view can open in a new tab: a click with Ctrl, Cmd, Shift or Alt opens it elsewhere and leaves the current tab active; a cancelled glk-tab-select stops the navigation as well (since 1.32.0)
slot="icon"glk-tab-itemAn icon that is not inline SVG — a font icon, an <img>, an element of your own; it takes the state colour (since 1.28.0). An <svg> without slot is copied in as before.
orientationglk-tab-barvertical: a column, for a sidebar (since 1.32.0)
dockglk-tab-barstart | end, with vertical: fixed to that edge of the viewport, clear of its safe area (since 1.32.0)
railglk-tab-barWith vertical: the icons alone, each label in a tooltip (since 1.32.0); rail="labels" keeps the label under the icon (since 1.33.0)
placementglk-tab-bartop: a horizontal bar for the top of a page (since 1.32.0)
labelglk-tab-barThe navigation’s name, its aria-label (since 1.32.0)
leading (slot)glk-tab-barA mark or the accessory before the items — above them in a column (since 1.33.0)
trailing (slot)glk-tab-barA foot such as the account, at the far end (since 1.33.0)

Events: glk-tab-select on the item, then glk-tab-change → { tab: Element } on the bar. Since 1.28.0 glk-tab-select comes before active changes and is cancelable: preventDefault() keeps the current tab — for an item that opens a drawer or a link. Then nothing changes, no glk-tab-change follows, and the drop stays; a drag of the drop that ends on such an item takes the same path and goes back.

<glk-tab-item label="Home" active> <span slot="icon" class="material-icons" aria-hidden="true">home</span> </glk-tab-item> <glk-tab-item id="menu" label="Menu">...</glk-tab-item> menu.addEventListener('glk-tab-select', (event) => { event.preventDefault(); // stays on the current tab openDrawer(); });

Give a font icon aria-hidden="true", or its text joins the tab’s name. GlassKit’s tab bar tokens reach the items by inheritance (GlassKit 1.28.0): --gl-tab-bar-color for the inactive tabs, --gl-tab-bar-hover-color, --gl-tab-bar-label-size and --gl-tab-bar-z-index.

Since 1.32.0 the active item tells a screen reader which view is open with aria-current="page", and every item shows a focus ring for the keyboard. Parts: nav on the bar, item on each item — its button, or its link with href; leading and trailing on the bar’s two places (since 1.33.0).

Sidebar, rail and top bar (since 1.32.0). One set of items in more places than the bottom edge. orientation="vertical" makes the bar a column, one item per row with the icon before the label and the badge at the row’s end: a sidebar in a column of the page’s layout, as high as its container. With dock="start" or "end" it is fixed to that edge of the viewport instead, full height and clear of the edge’s safe area — the side a phone’s thumb reaches when the system moves its own controls there, as on a phone held open. rail shows the icons alone; the label stays the item’s name and shows in a tooltip beside the rail, on hover, focus and a long press. placement="top" lays a horizontal bar out for the top of a page: in the flow — put it in a sticky header —, its border below, no room for the home indicator, and from 640 px the icon beside the label. In a column the drop of droplet runs along y. The page switches between the layouts with a media query or on resize, and the items are not rendered again. Try it — tap a row or drag the drop in the sidebar, hover the rail:

<!-- A sidebar in a column of the page's grid --> <glk-tab-bar orientation="vertical" droplet label="Main"> <glk-tab-item label="Dashboard" active><svg>...</svg></glk-tab-item> <glk-tab-item label="Customers" badge="3" badge-label="3 new"><svg>...</svg></glk-tab-item> <glk-tab-item label="Invoices" href="/invoices"><svg>...</svg></glk-tab-item> </glk-tab-bar> <!-- The same items as an icon rail at the start edge of the viewport --> <glk-tab-bar orientation="vertical" rail dock="start" label="Main">...</glk-tab-bar> <!-- A top bar in a sticky header --> <header style="position: sticky; top: 0"> <glk-tab-bar placement="top" droplet label="Main">...</glk-tab-bar> </header> // One bar, switched by the width of the screen const bar = document.querySelector('glk-tab-bar'); const wide = matchMedia('(min-width: 1024px)'); const apply = () => { bar.orientation = wide.matches ? 'vertical' : 'horizontal'; }; wide.addEventListener('change', apply); apply();

A docked bar lies over the page; the page keeps room for it on that side. GlassKit’s tab bar tokens reach these layouts as well: --gl-tab-bar-rail-width (72 px) sets the width of the rail, --gl-tab-bar-active-bg the surface of the active row in a sidebar.

A rail with labels, a mark and the account (since 1.33.0). rail="labels" keeps the label under the icon, as on the floating bar — a desktop rail that names its items, so it adds no tooltips. The items fill the rail’s width (--gl-tab-bar-rail-width, 72 px; 96 px below), are at least 62 px high (--gl-tab-bar-rail-item-height) and rounded like a button, 16 px, and the drop takes the same corners; --gl-tab-bar-label-size sets the labels. slot="leading" holds a mark and the accessory above the items — before them in a row —, slot="trailing" a foot such as the account, at the far end. Each place shows only while something is in it, and neither counts as an item for the drop or the selection. The property rail reads true, false or "labels". Try it — tap an item, drag the drop, press the assistant:

MK
AppThe page beside the rail.

With floating and dock the rail is a pane of its own glass at that edge: full height, --gl-tab-bar-floating-inset (16 px) from the edge and from both ends, clear of the safe areas, with the corners of a card (--gl-tab-bar-rail-radius, 24 px). The page keeps room for it at that edge, here 96 + 2 × 16 px. The design of a back office, as a whole:

<glk-tab-bar floating orientation="vertical" rail="labels" dock="start" droplet label="Main" style="--gl-tab-bar-rail-width: 96px; --gl-tab-bar-label-size: 12px"> <img slot="leading" src="/mark.svg" alt="" width="40" height="40"> <glk-tab-accessory slot="leading" variant="accent" label="Assistant" show-label><svg>...</svg></glk-tab-accessory> <glk-tab-item label="App" active><svg>...</svg></glk-tab-item> <glk-tab-item label="Report"><svg>...</svg></glk-tab-item> <glk-tab-item label="Catalog"><svg>...</svg></glk-tab-item> <glk-button slot="trailing" variant="tertiary" size="sm auto" aria-label="Account">MK</glk-button> </glk-tab-bar> main { margin-inline-start: 128px; } /* 96 + 2 × 16 */

The items’ tokens (GlassKit 1.33.0). --gl-tab-bar-icon-size (24 px) sizes the icon box and the SVG — 18 px for a compact top bar drawn like the segmented control. --gl-tab-bar-item-radius rounds the floating items and the drop, unset a capsule, 16 px in a rail with labels. --gl-tab-bar-active-weight sets the weight of the active label, unset the medium of every label. They reach the items by inheritance. The items now transition their colours, the press and the shadow only: a bar that switches its layout — upright, floating, a rail — stands in its new form at once, where it took 250 ms to settle before, and an item measured meanwhile was not yet its size.

glk-tab-bar[placement="top"] { --gl-tab-bar-icon-size: 18px; --gl-tab-bar-item-radius: 12px; --gl-tab-bar-active-weight: 600; }

A dot without a count (since 1.38.0). badge-dot marks an item without a number — an open payment at the account tab —: GlassKit 1.38.0’s .glass-tab-bar__badge--dot, 10 px in the plain error red with a 2 px ring in the colour behind the bar, at the icon’s corner, and in a sidebar at the row’s end. The dot says nothing to a screen reader, so badge-label says why: the item is named “Account, a payment is open”. GlassKit’s --gl-tab-bar-badge-size, -top, -end, -ring-width and -ring-color set the count and the dot, and the part badge reaches either.

<glk-tab-item label="Account" badge-dot badge-label="a payment is open">…</glk-tab-item> glk-tab-bar { --gl-tab-bar-badge-ring-color: var(--app-bar-bg); }

<glk-tab-dock> + <glk-tab-bar floating> + <glk-tab-accessory>

Pill-shaped, centered, floating tab bar inspired by iOS 26 Liquid Glass. Pair with an optional <glk-tab-accessory> capsule (e.g. search, compose). The active tab gets a soft radial Spotlight halo instead of the underline dot. Use .glass-bg--has-tab-bar-floating on the outer background.

<glk-tab-dock> <glk-tab-bar floating> <glk-tab-item label="Home" active><svg>...</svg></glk-tab-item> <!-- more items --> </glk-tab-bar> <glk-tab-accessory variant="accent" label="Compose"> <svg>...</svg> </glk-tab-accessory> </glk-tab-dock>
AttributeComponentDescription
floatingglk-tab-barPill-shaped Liquid Glass variant — Spotlight halo on the active item
dropletglk-tab-barThe active item sits on a drop of glass that glides to the next one and can be dragged (since 1.27.0); a property as well, like floating (since 1.28.0)
accessory-leftglk-tab-dockPlace the accessory on the left of the bar (default is right); in an upright dock above it (since 1.32.0)
orientationglk-tab-dockvertical: upright at a side of the viewport, the accessory below the bar (since 1.32.0)
dockglk-tab-dockend (default) | start — the edge of an upright dock (since 1.32.0)
labelglk-tab-accessoryaria-label for accessibility
variantglk-tab-accessoryaccent | success | error — filled colored capsule with white icon
disabledglk-tab-accessoryDisabled state
show-labelglk-tab-accessoryIts label under it as well — in a rail that names its items; property showLabel (since 1.33.0)

Events: <glk-tab-accessory> emits glk-click when clicked (suppressed when disabled). Its icon can be a font icon as well: the colour sits on the capsule and follows hover and the variants (GlassKit 1.28.0).

A name under the accessory (since 1.33.0). show-label sets the label under the capsule as well, for the leading place of a rail with labels. The label stays the button’s name; the visible one is hidden from assistive technology, so it is not read twice, and a click on it presses the button. Part: label, the visible one.

Tip: Use .glass-bg--has-tab-bar-floating on the outer .glass-bg instead of --has-tab-bar to reserve the right amount of bottom padding.

Droplet (since 1.27.0). droplet makes the selection fluid, as in iOS 26. The active item sits on a drop of glass that floats a little above the bar; a tap sends it to the new tab like water on a pane — the leading edge goes first, the trailing one follows, it runs flatter on the way and settles with a small wobble, and the icons it passes grow as under a lens. A finger can drag it along the bar; let go, and the tab below is selected exactly as by a tap, glk-tab-change included. Recommended for every floating bar: one attribute, nothing else changes. Try it — tap a tab, or drag the drop:

<glk-tab-bar floating droplet> <glk-tab-item label="Home" active><svg>...</svg></glk-tab-item> <!-- more items --> </glk-tab-bar>

It is GlassKit’s .glass-tab-bar--droplet, moved by GlassKit’s glasskit-droplet.js, which the bundles and the per-component files carry — an import map needs no new entry. Spotlight, dot and glow are off on a droplet bar; with prefers-reduced-motion the drop jumps, solid and tint surfaces make it opaque. GlassKit’s tokens for a capsule behind the active tab (--gl-tab-bar-active-bg, -shadow, --gl-tab-bar-spotlight-opacity, --gl-tab-bar-active-glow) reach the items by inheritance, and the drop takes that surface. Since 1.27.0 the items of a floating bar also really take the floating look: spotlight and pill, no dot.

Motion (GlassKit 1.32.0). The drop’s timing is set by tokens now — unset, today’s values —, read by the stylesheet and the script alike and inherited into <glk-tab-bar> and <glk-segmented>: --gl-droplet-duration and --gl-droplet-easing for the leading edge (0.3s), -trail-duration, -trail-delay and -trail-easing for the trailing one (0.5s after 40ms), -lift for the squash while it travels (0.86; 1 squashes nothing) and -lift-duration (280ms), -settle-duration and -settle-easing for the spring back (0.55s), -lens-duration and -lens-easing for the icon below the drop (0.4s). A product whose motion keeps within 240 ms writes this, and the drop arrives in 240 ms without a tail:

:root { --gl-droplet-duration: 240ms; --gl-droplet-easing: ease-out; --gl-droplet-trail-duration: 240ms; --gl-droplet-trail-delay: 0ms; --gl-droplet-trail-easing: ease-out; --gl-droplet-lift: 1; --gl-droplet-lift-duration: 0ms; --gl-droplet-settle-duration: 0ms; --gl-droplet-lens-duration: 240ms; --gl-droplet-lens-easing: ease-out; }

Keep --gl-droplet-lift-duration: 0ms in it: without it the lift’s deeper shadow still fades back until about 600 ms.

Upright (since 1.32.0). orientation="vertical" stands the dock at the end edge of the viewport — dock="start" for the other —, vertically centred and clear of that edge’s safe area, the accessory below the bar and above it with accessory-left. Give the bar inside orientation="vertical" as well: its items stay stacked as on the bottom edge, and the drop runs along y. Where a phone held open puts the thumb at a side rather than at the bottom edge, the navigation can go there — the same items, switched by a media query:

<glk-tab-dock orientation="vertical" dock="end"> <glk-tab-bar floating droplet orientation="vertical"> <glk-tab-item label="Home" active><svg>...</svg></glk-tab-item> <!-- more items --> </glk-tab-bar> <glk-tab-accessory variant="accent" label="Compose"><svg>...</svg></glk-tab-accessory> </glk-tab-dock> // Upright on a wide touch screen, at the bottom edge elsewhere const dock = document.querySelector('glk-tab-dock'); const side = matchMedia('(min-width: 700px) and (pointer: coarse)'); const apply = () => { const orientation = side.matches ? 'vertical' : 'horizontal'; dock.orientation = orientation; dock.querySelector('glk-tab-bar').orientation = orientation; }; side.addEventListener('change', apply); apply();

<glk-steps>

Progress through a short flow, purely presentational: the current step carries aria-current="step", done steps show an SVG check. Narrowing in tight frames is the CSS block's container query (below 360 px only the current label stays) — the element knows nothing about it. Since GlassKit 1.28.0 the lines give way there first, the circles keep their size, and the row never runs past its frame: seven steps keep an 88 px label whole from a 310 px column on.

<glk-steps steps="Day,Slot,Dog,Confirm" current="2"></glk-steps>
AttributeTypeValues
stepsStringComma-separated labels, or since 1.35.0 a JSON array of labels or of { "label", "state" } with done, current or todo
currentNumber0-based index of the current step; the short form for steps in order — a step without a state takes it from here
labelStringaria-label of the list (optional)
done-labelStringWhat a screen reader hears after a done step, “done” by default (since 1.35.0)

A state per step (since 1.35.0), for steps done in any order: in a publication flow the address may be approved while the app is still untested. A done step says so in words too, since the position no longer tells.

<glk-steps steps='[{"label":"Test the app","state":"todo"},{"label":"Set the address","state":"done"},{"label":"Spread it","state":"current"}]'></glk-steps>

Property current reflects the attribute; steps accepts an array or comma-separated text. Part: steps.

<glk-date-strip>

A row of day chips that scrolls sideways — a booking horizon, the days around today. Chips are buttons in a role="group", the chosen one aria-pressed="true", each named with its full date. One tab stop: arrow keys move between chips, Home/End jump to the ends, Enter or Space picks. The chosen chip is scrolled to the middle of the strip after the first layout and on every value change — the strip alone scrolls, never the page. Weekday names come from Intl for the locale. Try it: the strip below starts with its 20th day chosen.

waiting for glk-change…
<glk-date-strip start="2026-09-22" days="29" value="2026-10-11" label="Pick a day" marks='{"2026-09-22":"success","2026-09-25":{"tone":"error","disabled":true}}'></glk-date-strip>
AttributeTypeValues
startStringFirst day YYYY-MM-DD; today when missing
daysNumberNumber of chips, default 7
valueStringChosen day YYYY-MM-DD
todayStringThe underlined day; the browser’s day when missing
marksJSON{ "2026-09-24": "warning", "2026-09-25": { "tone": "error", "disabled": true } } — tone: primary | success | warning | error; disabled makes the chip unpickable
localeStringBCP 47 tag for the weekday names and the chips’ aria-label; without it the page language — the lang of the nearest ancestor, usually <html lang>, also across shadow roots — else the browser language (page language since 1.19.2)
labelStringaria-label of the group

Events: glk-change { value } — only on a change made by the user. Properties: value, marks (object or JSON text), locale, label. Part: strip.

<glk-breadcrumbs> + <glk-breadcrumb>

The path through nested levels (since 1.32.0) — GlassKit’s .glass-breadcrumbs: My app › Main menu › Services › Online booking. The levels are <glk-breadcrumb> children; the element draws them as <nav aria-label><ol><li>, each level a link (href) or a button, the current one — current, else the last — plain text with aria-current="page". The separators are CSS, hidden from assistive technology and mirrored right to left. Where the path does not fit, the middle levels fold into one “…” crumb, a menu button named like “2 more levels” that lists them; the first crumb and the last two stay. The path is measured on the element, so it folds and unfolds with its own width, and a label cut short shows in full in a tooltip. Try it: the second path sits in a narrow box.

My app Main menu Services Online booking
My app Main menu Services and appointments Online booking Confirmation e-mail to the customer
waiting for glk-navigate…
<glk-breadcrumbs> <glk-breadcrumb href="/app">My app</glk-breadcrumb> <glk-breadcrumb href="/app/menu">Main menu</glk-breadcrumb> <glk-breadcrumb href="/app/menu/services">Services</glk-breadcrumb> <glk-breadcrumb current>Online booking</glk-breadcrumb> </glk-breadcrumbs> crumbs.addEventListener('glk-navigate', (event) => { event.preventDefault(); // the app routes by itself router.go(event.detail.href); });
AttributeComponentDescription
labelglk-breadcrumbsThe navigation’s name, “Breadcrumb” by default
collapseglk-breadcrumbsauto (default) folds the middle levels where the path does not fit; never keeps every crumb
more-labelglk-breadcrumbsThe name of the “…” crumb, with {count}: "{count} more levels"; by default “1 more level”, “2 more levels”
more-label-oneglk-breadcrumbsThe same for one folded level, where a language needs its singular: more-label="{count} weitere Ebenen" more-label-one="1 weitere Ebene"; without it more-label serves for one as well
drop-target, groupglk-breadcrumbsThe crumbs take items dragged from a sortable list or tree — see Sorting; both may change at run time
hrefglk-breadcrumbThe level is a link; without it a button
valueglk-breadcrumbWhat glk-navigate reports; the label when missing
currentglk-breadcrumbThe level shown, plain text with aria-current="page"; without it the last

Events: glk-navigate { item, value, href, index }, cancelable — for a crumb and for a level chosen from the “…” menu. Cancelled on a link it stops the browser’s navigation, so a single-page app routes by itself; a link without a listener just works, in a new tab too. Methods (since 1.34.0): dropTargetAt(x, y) and markDrop(target, { refused }), for a sorter of the page’s own — see Sorting. Parts: nav, list, crumb, current, overflow (the “…” crumb); the separators are CSS and have no part. A crumb is cut at GlassKit’s --gl-breadcrumbs-crumb-width (200 px), which reaches the element by inheritance.

Feedback

<glk-progress>

Progress bar with its label and value. Since 1.33.2 the element is the progress bar for assistive technology: role="progressbar" with the value, 0, max and the value text, named by label — or, for a bar without a visible label, by aria-label or aria-labelledby on the element.

<glk-progress label="Upload" value="75" variant="success"></glk-progress> <glk-progress label="Images this month" value="3" max="20" value-text="3 of 20"></glk-progress>
AttributeTypeValues
labelStringThe text over the bar at its start; names the bar
valueNumber0 – max; with decimals since 1.33.2
maxNumberThe value of a full bar, 100 by default; the fill is value / max (since 1.33.2)
value-textStringThe text at the end of the label row, such as 3 of 20, and the bar’s value text for screen readers; without it, the percentage (since 1.33.2)
variantStringsuccess | error
sizeStringsm | (default) | lg

Parts: label, value, track, fill (since 1.33.2)   Properties: value, max, valueText

<glk-modal>

Modal dialog with title, body, and action buttons. Since 1.20.0 it is a native <dialog>, opened with showModal(): it lies above everything else, the page behind it is inert for pointer, keyboard and screen readers, focus moves into it and goes back to where it came from when it closes, and its content is out of reach while it is closed. The title names the dialog.

Open Modal

Are you sure you want to proceed?

<glk-modal title="Confirm" id="my-modal"> <p>Are you sure?</p> <div slot="actions"> <button class="glass-modal__action">Cancel</button> <button class="glass-modal__action glass-modal__action--primary">OK</button> </div> </glk-modal> // Methods document.getElementById('my-modal').show(); document.getElementById('my-modal').close();
AttributeTypeDescription
openBooleanShow/hide
titleStringHeader title

Methods: .show(), .close() (a promise since 1.32.0)   Events: glk-open (whenever it opens, since 1.30.0), glk-close, glk-closed (since 1.32.0)

Since 1.35.0 glk-open, glk-close and glk-closed stay at the element: they do not bubble, as the native close and toggle do not, so a container around it no longer takes them for its own. Listen on the element itself.

While the modal is open the page behind it does not scroll (since 1.30.0): the top layer kept it inert for pointer and keyboard, but a wheel or a finger over the dimmed area still moved it.

glk-closed (since 1.32.0) follows once the modal has faded out and its dialog has closed, however it closed — Escape, the dimmed area, .close(), the attribute — and at once under prefers-reduced-motion; .close() returns a promise that settles at the same moment. A page that renders the modal from its state removes it there, and the fade shows; before, it had to guess the duration or cut the fade short.

modal.addEventListener('glk-closed', () => { state.dialog = null; render(); }); await modal.close(); // settles when the fade has ended

Which element gets the focus on opening, browsers decide differently — Chrome takes the first field of the content, Safari the first action. Mark one with autofocus, in the content or among the actions, to settle it. Escape and a click on the dimmed area close the modal with its fade and emit glk-close; .close() does not emit. While it is open, everything outside is inert — a <glk-toast> shown then is neither clickable nor announced, so give feedback inside the modal or close it first.

The actions are copies of the buttons in slot="actions", and a click on one is handed to its original. Since 1.28.0 the copies follow every change of the originals, attributes included: a confirm button that starts disabled unlocks once the page enables it, also through a framework that binds only disabled. A copy keeps its focus while it changes, and an inline onclick runs once per click, on the original — before, it ran twice.

<glk-toast>

Notification at the top of the screen that hides itself — and, since 1.19.0, one that offers something: with action-label (or show(message, { action })) it gets a button and an ×, and stays until one of them is used unless a duration is set. The action emits glk-action and closes the toast — unless a listener calls preventDefault() or shows the next message; the × and Escape emit glk-close. While the pointer or the focus is on it, it does not time out. It is a polite live region, so the message is announced.

Success Error With action waiting for glk-action / glk-close…
<glk-toast id="toast"></glk-toast> // Show programmatically document.getElementById('toast').show('Saved!', 'success', 3000); // With an action: stays until Reload or × is used toast.show('A new version is ready', { action: { label: 'Reload', value: 'reload' } }); toast.addEventListener('glk-action', e => { if (e.detail.action === 'reload') location.reload(); });
AttributeTypeValues
messageStringThe text
variantStringsuccess | error | warning — colours the icon and the action
durationNumberms; 0 keeps it up. Default 3000 — with an action, no timeout unless set
visibleBooleanShown
action-label, action-valueStringThe action button and the value glk-action reports (the label when missing) (since 1.19.0)
dismissibleBooleanAn × without an action; an action always brings one (since 1.19.0)
close-labelStringName of the ×, “Close” by default (since 1.19.0)

Methods: .show(message, variant, duration), .show(message, { variant, duration, action: { label, value }, dismissible }), .dismiss(). Slot: icon — replaces the built-in icon; leave its stroke unset and it takes the variant colour. Events: glk-action { action, label } (cancelable), glk-close (× or Escape), glk-dismiss (timed out).

Since 1.35.0 glk-close stays at the toast and does not bubble; glk-action and glk-dismiss still do.

Above a sheet or a modal (since 1.39.0): a <glk-sheet> or <glk-modal> lies in the top layer as a native dialog, and the toast, fixed in the page, stood under it and its blurred overlay — “That name is taken” for a sheet’s form could not be read. The toast is a popover="manual" now, open while it is in the document — hidden it stays invisible and lets the pointer through, and as a live region it keeps being read — and every show() puts it in again, last and so on top. Beside a modal it can be seen, but, as everything outside the dialog, not used or announced: put a message a screen reader must hear into the dialog itself. A toast shown before a dialog opens lies under it until its next show().

<glk-popover>

Anchored dropdown / menu container. Wraps a trigger element (via slot="trigger") and its floating content. The element manages .is-open toggling, outside-click dismiss, and Escape-key close internally — no manual class toggling needed. After Escape the focus goes back to the trigger when it was in the panel, since 1.38.0 also in a shadow root of an app’s own elements, where it stayed behind in the hidden panel.

Open menu
<glk-popover placement="end"> <glk-button slot="trigger" variant="secondary">Open menu</glk-button> <glk-list bare> <glk-list-item title="Share" interactive></glk-list-item> <glk-list-item title="Delete" variant="danger" interactive></glk-list-item> </glk-list> </glk-popover> // Imperative API document.querySelector('glk-popover').show(); document.querySelector('glk-popover').close(); document.querySelector('glk-popover').toggle();
AttributeTypeDefaultDescription
openBooleanfalseVisibility state (reflected as .is-open on the inner surface)
placementStringbottomtop | bottom | start | end — below the trigger and centred, above it with top; start and end align it at the trigger’s start or end edge
SlotPurpose
triggerElement that toggles the popover when clicked
(default)Floating content shown while open

Events: glk-open, glk-close. Since 1.35.0 glk-open, glk-close and glk-closed stay at the element: they do not bubble, as the native close and toggle do not, so a container around it no longer takes them for its own. Listen on the element itself. Escape closes the popover and is marked as handled (preventDefault(), since 1.35.0): a sheet or a modal around it stays open, and a container can tell from defaultPrevented that the popover took the key.

Methods: .show(), .close(), .toggle()

Heads-up: the method is deliberately called .toggle() — not .togglePopover(), which collides with the native HTMLElement.togglePopover() API.

The trigger tells whether the popover is open: it gets aria-expanded, also after it is swapped (since 1.20.0). <glk-button> and <glk-pill> hand it on to their native button.

Top layer (since 1.32.0). The panel opens in the top layer (the popover API), position: fixed there, so it sits right on a scrolled page too, and is placed by script: next to the trigger on the side placement asks for, flipped to the other side where the viewport leaves no room, shifted along it to stay inside, and kept there while the page scrolls. Before, it hung absolutely below the trigger: an overflow: hidden around it cut it off, at the screen’s edges it left the screen, and closed it still widened the page by its box. Escape gives the focus back to the trigger when it was inside the panel. For a list of actions, <glk-menu> brings the keyboard of a menu; the popover stays for free content.

<glk-tooltip>

A short name or hint for a control, on hover and focus (since 1.32.0) — GlassKit’s .glass-tooltip. The control is the element in slot="trigger", or the one for names by its id in the same document or shadow root, so a tooltip can serve a control rendered elsewhere; the text is the tooltip’s own content. Try it — hover the buttons, or reach them with Tab:

Rename Copies a link to this page Export Saves the list as a CSV file
<glk-tooltip as-label> <glk-button slot="trigger" variant="secondary" size="sm auto"><svg>...</svg></glk-button> Rename </glk-tooltip> <!-- Tied by id, to a control rendered elsewhere --> <glk-button id="export" variant="tertiary" size="sm auto">Export</glk-button> <glk-tooltip for="export" placement="end">Saves the list as a CSV file</glk-tooltip>
AttributeTypeValues
forStringThe id of the control, in the same document or shadow root; without it the element in slot="trigger"
placementStringtop (default) | bottom | start | end — start and end follow the writing direction
show-delayNumberms on hover before it shows, default 400; focus and a long press do not wait
as-labelBooleanThe text is the control’s name (aria-label) rather than its description — for an icon-only control

The text describes the control: it becomes the aria-description of the element that takes the focus — inside <glk-button>, <glk-pill> or <glk-tab-item> their native button — and follows changes of the text; with as-label it is the control’s name. Whatever the control said there before comes back when the tooltip goes. It shows on hover after show-delay, on keyboard focus at once, and by touch while a finger rests on the control — a long press of 500 ms, after which it stays 1.5 s; a tap never shows it and is never held up. It hides when the pointer leaves the control and the tooltip, so the pointer may move onto it (WCAG 1.4.13), on blur, on a press, and on Escape, which leaves the focus where it is and a dialog around it open. It lies in the top layer — popover="hint" where the browser knows it —, never cut off by a box around it, flipped and shifted to stay in the viewport.

Methods: show(), hide(). Properties: placement, htmlFor. Slots: default (the text), trigger. Part: tooltip. GlassKit’s tokens reach it by inheritance: --gl-tooltip-bg, --gl-tooltip-color, --gl-tooltip-max-width (240 px) and --gl-tooltip-offset, its distance from the control (8 px).

<glk-menu> + <glk-menu-item>

A menu button (since 1.32.0) — GlassKit’s .glass-menu: the overflow menu of a header, the actions of a table row. The button is the element in slot="trigger"; the items are <glk-menu-item> children, parted by <glk-menu-separator> and gathered in <glk-menu-group label>. It follows the WAI-ARIA menu button pattern: the button carries aria-haspopup="menu" and aria-expanded, the panel is role="menu" named by the button, the items are menuitem, menuitemcheckbox or menuitemradio. Try it with the mouse and with the keyboard:

Actions Rename⌘R Duplicate Move to… Pinned Name Date Delete waiting for glk-select…
<glk-menu placement="end"> <glk-button slot="trigger" id="more" variant="tertiary" size="sm auto"><svg>...</svg></glk-button> <glk-menu-item value="rename">Rename<span slot="trailing">⌘R</span></glk-menu-item> <glk-menu-item value="move" disabled>Move to…</glk-menu-item> <glk-menu-separator></glk-menu-separator> <glk-menu-item value="pinned" type="checkbox" checked>Pinned</glk-menu-item> <glk-menu-group label="Sort by"> <glk-menu-item value="name" type="radio" checked>Name</glk-menu-item> <glk-menu-item value="date" type="radio">Date</glk-menu-item> </glk-menu-group> <glk-menu-separator></glk-menu-separator> <glk-menu-item value="delete" variant="danger">Delete</glk-menu-item> </glk-menu> <!-- An icon-only button takes its name from a tooltip --> <glk-tooltip for="more" as-label>More actions</glk-tooltip> menu.addEventListener('glk-select', (event) => { if (event.detail.value === 'delete' && !confirm('Delete?')) event.preventDefault(); });
AttributeComponentDescription
openglk-menuOpen; also a property
placementglk-menubottom (default) and start: below the button, aligned at its start edge; end: aligned at its end edge; top: above it — flipped and shifted to stay in the viewport
valueglk-menu-itemWhat glk-select reports; the label when missing
typeglk-menu-itemcheckbox | radio — checkable, with a check mark; a radio item checks one of its group (<glk-menu-group>, else the menu)
checkedglk-menu-itemChecked, for type
disabledglk-menu-itemKeeps its place in the arrow path and is announced as unavailable, but cannot be chosen
variantglk-menu-itemdanger — the error colour, for a destructive action
labelglk-menu-groupShown above its items, and the group’s name

Keyboard: one tab stop. On the button, Enter, Space and Down open the menu at its first item, Up at its last. In the menu, Down and Up move and wrap, Home and End go to the ends, typed letters jump to the next item that starts with them, Enter and Space choose, Escape closes and gives the focus back to the button — a dialog around it stays open —, Tab closes and moves on. A pointer that hovers an item moves the focus to it; a click outside closes. Since 1.36.0 Escape also closes an open menu while the focus is elsewhere — opened by a click, Safari leaves the focus off the button —, and marks the key as handled.

Events: glk-select { item, value, checked }, cancelable and before anything happens: an item closes the menu and gives the focus back to the button; a checkbox item toggles and a radio item is checked, the others of its group unchecked, and both leave the menu open. Cancelled, nothing changes. glk-open, glk-close. Methods: show(), close() — close({ focus: true }) gives the focus back to the button —, toggle(). Slots: trigger, default (the items); on <glk-menu-item> default (the label), icon, trailing (a hint such as a shortcut). Parts: menu on the menu, item on each item. Since 1.35.0 the menu’s glk-open and glk-close stay at the element and do not bubble; glk-select still does.

The panel lies in the top layer like the popover’s, never cut off by an overflow: hidden around it, so a menu in a table row or a card opens in full. The roles and states sit on the elements themselves (ElementInternals), so the items are the menu’s own across the slot; <glk-menu-separator> is role="separator", <glk-menu-group> role="group".

<glk-sheet>

Bottom sheet — the mobile sibling of <glk-modal>. Since 1.30.0 its overlay is a native <dialog> opened with showModal(), like the modal’s: it lies in the top layer, above every fixed or transformed element of the page whatever its z-index — a tab bar with a backdrop filter can no longer land above it —, the page behind it is inert and does not scroll, and focus moves in (an autofocus element takes it). Opening and closing are animated by GlassKit's .glass-sheet block, and under prefers-reduced-motion it switches at once. It emits glk-open whenever it opens — attribute, property or show() — so a page can hide its own fixed bars; scrim click and Escape close it and emit glk-close, close() does not. inline embeds the panel in the flow without an overlay.

Sheet content: a list, text, a form. This one is inline.

Open as overlay

Tap outside or press Escape to close.

Close
<glk-sheet id="sheet" title="Rebook to …"> <p>…</p> <glk-button slot="actions" onclick="sheet.close()">Close</glk-button> </glk-sheet> <script>sheet.show();</script>
AttributeTypeValues
openBooleanShown as an overlay
inlineBooleanIn the flow, no overlay, always visible
titleStringHeading and aria-label
labelStringThe dialog’s name without a visible title (since 1.35.0; before, it had none)
dismissibleBooleanA round close button at the end of the head (since 1.35.0); a click on it closes like a click outside, with glk-close
close-labelStringIts name, “Close” by default (since 1.35.0)
placementStringbottom (default) | start | end: a panel at that side, full height, without grip, actions side by side (since 1.35.0)
modelessBooleanOpened with show(): no scrim, the page stays usable, other dialogs open above it (since 1.35.0). Set or removed on an open sheet, it reopens in the other mode, and the page’s scroll lock follows (since 1.40.0)
initial-focusStringpanel: a modal sheet starts at its panel, not at the first field it holds — no on-screen keyboard over a sheet that is opened to be read (since 1.39.0)

Methods: show(), close(). Slots: default (content), actions; since 1.35.0 eyebrow (a short line above the title), leading and trailing (before and after it in the head); since 1.36.0 subtitle (below it). Parts: overlay, sheet, title, body, actions; since 1.35.0 grip, head, eyebrow, leading, trailing, close; since 1.36.0 subtitle and close-icon, the glyph of the close button. Events: glk-close — only when the user closes it (scrim, Escape); glk-closed — once it has slid out (since 1.32.0).

glk-closed (since 1.32.0) follows once the sheet has slid out and its dialog has closed, however it closed — scrim, Escape, close(), the attribute — and at once under prefers-reduced-motion; close() returns a promise that settles at the same moment. A page that renders the sheet from its state removes it there, and the slide shows. An inline sheet shows no overlay, so nothing slides: close() settles at once.

The head (since 1.35.0): slot="eyebrow" puts a short line above the title, leading a mark or an icon chip before it, trailing a badge after it, and dismissible a round close button at its end, named by close-label. Each place shows only while it holds something; a title alone stands as before. Without a title, label names the dialog. Since 1.36.0 slot="subtitle" puts a badge or a line below the title, where one in trailing squeezed the title in a narrow sheet, and the head of a sheet without a title, places and close button takes no room (GlassKit 1.36.0; before, it kept 8 px). GlassKit’s --gl-sheet-close-size, --gl-sheet-close-icon-size and --gl-sheet-close-icon-stroke size the close button and its glyph, and the part close-icon reaches the glyph.

Restore 1× in your app

Restoring replaces the current version.

1× in your app

The badge stands below the title, which keeps its width; the close button is plain, 44 px with a 20 px glyph.

<glk-sheet title="Picture gallery" dismissible> <span slot="leading" class="chip">…</span> <glk-badge slot="subtitle" variant="success">1× in your app</glk-badge> … </glk-sheet> glk-sheet { --gl-sheet-close-size: 44px; --gl-sheet-close-icon-size: 20px; --gl-sheet-close-icon-stroke: 1.8; } glk-sheet::part(close) { background: transparent; border-color: transparent; box-shadow: none; } glk-sheet::part(close):focus-visible { box-shadow: var(--gl-shadow-focus); }

At a side, modeless (since 1.35.0): placement="end" or "start" puts the panel at that side of the window, as high as the window less 16 px at both ends, 440 px wide (GlassKit’s --gl-sheet-side-inset and --gl-sheet-side-width), sliding in from that side, mirrored right to left, without a grip and with its actions side by side — a side panel on a desktop. modeless opens it with show() instead of showModal(): no scrim, the page stays usable and its chosen row in view, a modal opened later lies above it, Escape inside it closes it and a click outside does not, and the focus moves into the panel on opening — or to what carries autofocus — and back where it came from on closing. Since 1.36.0 a popover or menu open in a modeless sheet closes first on Escape — before, the sheet closed and left it open in the top layer —, and GlassKit’s --gl-sheet-side-inset-block-start and -block-end set the top and the bottom on their own, below a fixed bar of the page.

Open at the side Open modeless Component

A modal panel at the end edge, full height.

CancelSave

The page stays usable beside it. Escape closes it.

<glk-sheet title="Version from 09:41" dismissible> <span slot="eyebrow">Restore</span> <span slot="leading" class="chip">…</span> <glk-badge slot="trailing">1× in your app</glk-badge> <p>Restoring replaces the current version.</p> </glk-sheet> <glk-sheet title="Edit entry" placement="end" modeless dismissible>…</glk-sheet> <!-- beside the list -->

Events (since 1.35.0): glk-open, glk-close and glk-closed stay at the element: they do not bubble, as the native close and toggle do not, so a container around it no longer takes them for its own. Listen on the element itself. On dark mode’s glass the sheet’s glow starts lower, and the controls on it keep their contrast — see GlassKit 1.35.0’s dark glass.

Where the focus starts (since 1.39.0): showModal() focuses the first thing a sheet holds, and when that is a text field a phone brings up its keyboard over the sheet. initial-focus="panel" starts a modal sheet at its panel instead, as a modeless one does; an element with autofocus still wins. The sheet slides in whatever takes the focus: GlassKit 1.39.0’s overlay clips without scrolling, and the sheet focuses without scrolling — a focus while it slid in used to scroll the overlay, and the panel stood at its place at once or swung past it.

Containers

<glk-accordion> + <glk-accordion-item>

Collapsible accordion sections.

Content for section 1. Content for section 2.
<glk-accordion> <glk-accordion-item title="FAQ" open> Answer here. </glk-accordion-item> </glk-accordion>
AttributeComponentDescription
titleglk-accordion-itemTrigger text
openglk-accordion-itemExpanded state

Events: glk-toggle → { open: boolean }   Parts: item, trigger, content, body (since 1.30.0)

The trigger carries aria-expanded and aria-controls; a closed section is inert, so its links and fields are out of the tab order and out of the accessibility tree until it opens (since 1.20.0). An open section takes the height of its content, however long, and slides to it (GlassKit 1.30.0) — until then it ended at 500 px and cut off the rest.

A summary in the head (since 1.39.0): slot="summary" puts the values of a closed entry beside its title — a headline, a date — in GlassKit’s .glass-accordion__summary: the room up to the chevron, one muted line with an ellipsis. It stands inside the trigger, so a click on it, Enter and Space open the item as on the title, and it is part of the trigger’s name. It shows while something is slotted; hide it while the item is open, where the fields show the values themselves, with glk-accordion-item[open] [slot="summary"] { display: none; }. Part: summary. Since GlassKit 1.39.0 the trigger also shows a ring for the keyboard.

Summer party · 31.10.2026 · Lena HoffmannThe fields of the entry.
<glk-accordion-item title="Details of the news"> <span slot="summary">Summer party · 31.10.2026 · Lena Hoffmann</span> … </glk-accordion-item>

<glk-list> + <glk-list-item>

iOS-style grouped settings list. Items carry a leading icon, title + optional subtitle, and a trailing element. Dividers between items are drawn automatically — never add <hr> markup between items. Supports section headers, large icons, multi-line subtitles, trailing values, and semantic variants.

<glk-list header="Recommendations"> <glk-list-item title="Review media" subtitle="Save up to 1.38 GB." leading-lg wrap interactive> <svg slot="leading">...</svg> <svg slot="trailing">...</svg> </glk-list-item> <glk-list-item title="App" leading-lg detail="24 MB" interactive>...</glk-list-item> <glk-list-item title="Delete" variant="danger" center interactive></glk-list-item> <glk-list-item title="View all" variant="accent" center interactive></glk-list-item> </glk-list>
AttributeComponentDescription
headerglk-listSection header text — uppercase label above the list
flushglk-listEdge-to-edge variant — removes side borders and radius and reaches the edges of its container: a <glk-card>, the body of a <glk-modal>, a <glk-sheet> (both edges since 1.29.1; elsewhere --gl-list-flush-inset names the container’s padding, 20 px unless set)
bareglk-listStrips background, border, shadow — for embedding inside <glk-popover> or <glk-card>
sortableglk-listThe items can be reordered by mouse, touch and keyboard (since 1.32.0) — see Sorting
groupglk-listLists with the same group exchange items, and breadcrumbs of that group take them (since 1.32.0)
gridglk-listThe items as tiles side by side, each a pane of glass (since 1.34.0) — below
handleglk-list, glk-list-itemstart puts the handle before the icon, end (default) after the trailing content; on the list for all its items, an item’s own wins (since 1.34.0)
titleglk-list-itemPrimary text
subtitleglk-list-itemSecondary text (muted, optional)
interactiveglk-list-itemHover / focus / active states + emits glk-click; since 1.32.0 a button for the keyboard and assistive technology: in the Tab order, Enter and Space click it — in a sortable list Space picks it up —, a focus ring shows
containerglk-list-itemIn a sortable list: takes a dropped item inside it, a submenu (since 1.32.0)
no-dragglk-list-itemIn a sortable list: stays where it is (since 1.32.0)
selectedglk-list-itemThe entry a list beside its detail shows: a pill of raised glass, aria-current="true" on the row; the page sets it (since 1.34.0)
centerglk-list-itemCentered single-text variant (e.g. for action rows)
leading-lgglk-list-itemLarge 40×40 leading icon with rounded corners (for app icons)
wrapglk-list-itemMulti-line subtitle (up to 3 lines with ellipsis)
detailglk-list-itemMuted trailing value text (e.g. file size, version)
variantglk-list-itemdanger (red destructive) or accent (primary color)
SlotComponentPurpose
leadingglk-list-itemIcon slot (24×24 SVG, or 32×32 with leading-lg)
trailingglk-list-itemChevron, badge, or button (rendered after detail value)
title-trailingglk-list-itemBeside the title — a badge such as “AI”, a mark —; it moves under the title where the row is too narrow (since 1.35.0)
extraglk-list-itemBelow the subtitle: a link (“Undo”), a line of chips (since 1.35.0)
handleglk-list-itemA grip at the row’s end, or its start with handle="start" (since 1.34.0): in a sortable list a pointer starts a drag only there, a finger at once; the keyboard still picks the item up on its row (since 1.32.0)

Events: glk-click on <glk-list-item> when interactive is set. A sortable list emits the glk-sort events and takes messages, the texts it announces — see Sorting.

Parts (since 1.34.0): item, the row, and handle on <glk-list-item>; since 1.35.0 also title, subtitle, title-trailing and extra, since 1.36.0 leading and trailing; header and list on <glk-list>. GlassKit’s --gl-list-title-size, --gl-list-title-weight and --gl-list-subtitle-size set a row’s type (since 1.35.0), and --gl-list-item-selected-inset, -radius, -shadow, -color and -weight shape the chosen row — 0, 0, none make a flat tint over the whole row. Since 1.36.0 the title of the chosen row takes the row’s colour, so -color reaches it, and --gl-list-leading-width widens the leading box — a time and a chip before the text —, the dividers following it.

AIUndo
09:41 08:15

A list beside its detail (since 1.34.0): selected marks the entry an editor next to the list shows. GlassKit’s .is-selected lays a pill of raised glass into the row, as the selected item of a <glk-tree> has, and the row says aria-current="true". The page sets it — a click does not — and moves it when another entry opens.

<glk-list aria-label="Pages"> <glk-list-item title="Home" interactive></glk-list-item> <glk-list-item title="Opening hours" interactive selected></glk-list-item> </glk-list>

Tiles (since 1.34.0): grid lays the items out side by side, as many columns as fit at GlassKit’s --gl-list-tile-width (140 px). Every tile is a pane of glass of its own: the icon at the top, title and subtitle at its foot, the trailing slot in the top end corner, no dividers. Sorted, the tiles move on the horizontal axis — before a tile on its start half, after it on its end half, into a container in its middle — and the line stands upright in the gap. The keyboard keeps their order: Up and Down step from place to place, Right goes into a container. Drag a tile, or drop one into “Submenu”.

New waiting for glk-sort…
<glk-list grid sortable aria-label="Components"> <glk-list-item title="News" subtitle="Component"><svg slot="leading">...</svg></glk-list-item> <glk-list-item title="Submenu" subtitle="2 components" container>...</glk-list-item> </glk-list>

The grip first (since 1.34.0): handle="start" on the list, or on one item, puts the handle before the icon, and the keyboard reaches a button in it before the row’s other controls. Its width is the page’s, so the dividers run from the row’s padding until GlassKit’s --gl-list-item-divider-inset says where the text begins.

<glk-list sortable handle="start" style="--gl-list-item-divider-inset: 90px"> <glk-list-item title="News" subtitle="Component"> <svg slot="handle" aria-hidden="true">...</svg> <!-- 18px grip, before the 28px icon --> <svg slot="leading">...</svg> </glk-list-item> </glk-list>

Until 1.32.0 an interactive item was a plain list item that only a pointer could reach. Now its row is a button: it takes the focus in the Tab order, Enter clicks it on keydown and Space on keyup, as on a native button — in a sortable list Space picks the item up instead —, and a screen reader announces it as a button.

Changes in place (since 1.32.0): as in <glk-tree>, the page appends, removes and moves items with the DOM’s own methods, without rendering the list again. A moved item is the same element and keeps the focus; the focus of a removed one goes to the item that took its place, else to the one before it — while the focus was in the list. highlight() on an item flashes its row for 1.2 s (GlassKit’s .is-flash, tinted by --gl-flash-color), for an item that changed elsewhere; under prefers-reduced-motion nothing flashes.

Wrapping text (since 1.23.0): title and subtitle keep to one line, and wrap clamps the subtitle at three lines. GlassKit’s list tokens change that for a whole app, one list or one row — they are inherited into the element: --gl-list-title-white-space and --gl-list-subtitle-white-space (normal wraps) and --gl-list-subtitle-lines (the clamp of wrap, none shows every line). A word wider than the column breaks instead of running out of the row, and hyphens set on glk-list or the page reaches the text as well.

:root { --gl-list-title-white-space: normal; --gl-list-subtitle-white-space: normal; --gl-list-subtitle-lines: none; }

Framework-safe: both elements use pure Shadow DOM with slot projection — no child node cloning — so they compose cleanly inside lit-html templates, HybridsJS, React, Vue, and Svelte.

<glk-tree> + <glk-tree-item>

A tree with levels that open and close (since 1.32.0) — GlassKit’s .glass-tree: the structure of an app, menus with submenus, folders. The levels are nested <glk-tree-item> elements. It follows the WAI-ARIA tree view: role="tree" named by label, one tab stop — the selected item, else the first — and the keyboard below. A click on a row selects it, a click on its twisty opens or closes it. The tree has no surface of its own: put it in a card or a sidebar. Try it — open “Footer”, whose children load when it opens, and “Archive”, whose first load fails; the button moves “Contact” as another device would:

New Move “Contact” from elsewhere waiting for glk-tree-select…
<glk-tree label="App structure"> <glk-tree-item label="Main menu" value="main" expanded> <svg slot="icon">...</svg> <glk-tree-item label="Home" value="home"></glk-tree-item> <glk-tree-item label="Online booking" value="booking" selected> <glk-badge slot="trailing" variant="primary">New</glk-badge> </glk-tree-item> </glk-tree-item> <glk-tree-item label="Footer" value="footer" has-children></glk-tree-item> </glk-tree> tree.addEventListener('glk-tree-load', async (event) => { const { item } = event.detail; try { item.append(...await loadChildren(item.value)); // <glk-tree-item> elements } catch { item.loadError = 'The server did not answer.'; // opening it again retries } }); // A change from elsewhere: in place, then flashed const contact = tree.querySelector('[value="contact"]'); contact.label = 'Contact us'; contact.highlight();
AttributeComponentDescription
labelglk-treeThe tree’s name
selectionglk-treesingle (default) | none — with none no item is selected, and glk-tree-select still comes: a tree of links
sortable, groupglk-treeThe items move by mouse, touch and keyboard — see Sorting
labelglk-tree-itemThe row’s text and the item’s name — its children’s text stays out of it
valueglk-tree-itemWhat glk-tree-select reports and the tree’s value; the label when missing
expandedglk-tree-itemOpen
selectedglk-tree-itemSelected; one item per tree
disabledglk-tree-itemReached by the arrow keys and announced as unavailable, but not selected
has-childrenglk-tree-itemChildren still to come: the twisty shows before any child exists, and opening the item loads them, once
load-errorglk-tree-itemThe children could not load, the reason as its value (property loadError) — see below
container, no-dragglk-tree-itemFor a sortable tree — see Sorting

Keyboard: Down and Up move to the next and previous visible item, Home and End to the first and the last; Right opens an item or moves to its first child, Left closes it or moves to its parent, both mirrored right to left; Enter and Space select — the selection does not follow the focus; * opens every sibling; a typed letter moves to the next item that starts with it. The keys and the typed letters work on what has loaded.

Events: glk-tree-toggle { item, expanded } and glk-tree-select { item, value }, cancelable and before anything changes; glk-tree-load { item, retry }, below. Properties: value (the selected item’s), items (the top level; on an item its children); on an item also loading and loadError. Method of <glk-tree-item>: highlight(). Slots of <glk-tree-item>: default (the child items), icon, trailing (a badge, a status, an action — a click there selects nothing), handle. Parts: tree; on the item item, row, twisty, label, group, and since 1.34.0 icon and handle. The icon field is GlassKit’s --gl-tree-icon-size square (18 px, since 1.34.0): 28px takes a tinted chip as list rows show, where it was squeezed to 18 px before.

Loading on demand. has-children says that children are still to come. Opening such an item emits glk-tree-load { item, retry }, cancelable; the item then loads — loading is true, aria-busy is set, a spinner takes the twisty’s place — until child items arrive or has-children goes. It loads once: closed and opened again, it keeps its children and emits no second load; has-children added again after it went allows another. An item moved into one that has not loaded yet loads nothing and does not count as loaded, so opening it later still emits glk-tree-load. Cancelled, the item shows no loading state, for a page that fills it from a cache or reports an error itself; children appended inside the handler count as loaded at once.

When loading fails, the page sets load-error="message" (property loadError; an empty value reads “Could not load.”). The item closes and shows GlassKit’s .is-error — the twisty turns into a “!” in the error colour —, the message becomes the item’s description, and the tree announces “Label: message” in a polite live region. Opening the item again retries: load-error goes, and glk-tree-load comes with retry: true.

Changes in place. The page appends, removes, moves and renames items with the DOM’s own methods, without rendering the tree again: expanded levels, the selection and the scroll position stay, and a moved item is the same element. The focus stays on a moved item; where the focused item was removed, it goes to the one that took its place, else to the one before it, else to the open item around it, and where the item now lies in a level that closed, to the open item around it. That only while the focus was in the tree: a focus that left by Tab, a click or the page’s own focus() stays where it went. highlight() flashes an item’s row for 1.2 s — GlassKit’s .is-flash, tinted by --gl-flash-color —, for an item that changed elsewhere: on another device, by an undo, in an AI run. Under prefers-reduced-motion nothing flashes.

The roles and states sit on the items themselves (ElementInternals): treeitem, aria-level, aria-setsize and aria-posinset — the browser cannot count them through the slots —, aria-expanded, aria-selected, aria-disabled and, while children load, aria-busy. GlassKit’s tokens reach the tree by inheritance: --gl-tree-indent (20 px per level) and --gl-tree-row-height (36 px).

<glk-table>

A native <table class="glass-table"> in its light DOM, kept a table — its semantics, copy and paste, find in page, markup rendered on the server — with what a list of invoices or users needs around it (since 1.32.0): sortable headers, a header that stays in view while the rows scroll, row actions within reach, an empty state, and cards on narrow screens. The table stays in the page, so the page’s glasskit.css styles it. Try it — sort a column, scroll the box, open a row’s menu; below 640 px of width the rows become cards:

InvoiceCustomerDateAmountStatus
2026-1048Bergmann Bakery2026-10-271,240.00 €OpenOpenDownload PDFCancel invoice
2026-1047Kaya Florists2026-10-2486.50 €PaidOpenDownload PDFCancel invoice
2026-1046Northside Dental Practice2026-10-213,980.00 €OverdueOpenDownload PDFCancel invoice
2026-1045Alder & Sons Joinery2026-10-17512.30 €PaidOpenDownload PDFCancel invoice
2026-1044Marlow Yoga Studio2026-10-12149.00 €PaidOpenDownload PDFCancel invoice
2026-1043Okafor Translations2026-10-08720.00 €OpenOpenDownload PDFCancel invoice
waiting for glk-table-sort…
InvoiceCustomerDateAmount
<glk-table sticky-header list-below="640px" sort="date" direction="descending"> <table class="glass-table"> <thead><tr> <th data-sort="invoice">Invoice</th> <th data-sort="date">Date</th> <th class="glass-table__num" data-sort="amount">Amount</th> <th class="glass-table__actions" aria-label="Actions"></th> </tr></thead> <tbody> <tr> <td>2026-1048</td><td>2026-10-27</td> <td class="glass-table__num">1,240.00 €</td> <td class="glass-table__actions"><glk-menu placement="end">...</glk-menu></td> </tr> </tbody> </table> <glk-empty slot="empty" title="No invoices"></glk-empty> </glk-table> table.addEventListener('glk-table-sort', (event) => { const { key, direction } = event.detail; loadInvoices({ sort: key, direction }).then(renderRows); // the page sorts });
AttributeTypeValues
sortStringThe data-sort key of the sorted column
directionStringascending (default) | descending
sticky-headerBooleanThe wrap scrolls both ways, as high as --gl-table-max-height (60vh), and the header cells stick to its top on a surface of their own
list-belowStringA width such as 640px: narrower than that — measured on the element, not the viewport — each row becomes a card

Sorting. A header cell with data-sort="<key>" gets a button inside it and aria-sort on itself (ascending, descending, none). A click, Enter or Space emits glk-table-sort { key, direction } — ascending for a new column, then turning —, cancelable and before the state changes. The page sorts the rows, often on the server, and renders them; the element only shows the state, which sort and direction set.

Row actions. Cells with class="glass-table__actions" stay at the row’s end while the table scrolls sideways, on a surface of their own: a <glk-menu>, or icon buttons with a <glk-tooltip>. The wrap’s edges shade where more columns wait. Sort buttons and row actions are in the Tab order; there is no grid navigation with arrow keys.

Empty. While the body has no rows, the slot="empty" content — a <glk-empty> — shows below the header. Cards. Below list-below the element copies each header’s text into its column’s cells as data-label, and GlassKit shows it before the value; the actions move to the card’s top end, numbers keep their tabular figures. The header stays for assistive technology, hidden from view, and the table’s roles are set explicitly, so a screen reader still meets a table.

Events: glk-table-sort. Properties: sort, direction, stickyHeader, listBelow. Slots: default (the table), empty. Parts: wrap (the scroller), empty. GlassKit’s tokens reach the table: --gl-table-max-height, --gl-table-header-bg, --gl-table-cell-padding (9px 10px) and --gl-table-header-padding (8px 10px).

Sorting by drag and drop

sortable on <glk-list> or <glk-tree> lets the visitor reorder the items (since 1.32.0): with mouse and pen after a few pixels, by touch after a long press of 500 ms — before it a swipe scrolls the page —, and with the keyboard. A raised copy follows the pointer, a line shows where the item lands, an item that takes it inside lights up, and the others glide out of the way. Lists with the same group exchange items, and so do trees, but a list never with a tree; breadcrumbs of that group take items from both. Without a group a list or a tree keeps its items to itself, and breadcrumbs with drop-target and no group still take them. Items with container — in a tree also items with children — take others inside them; in a tree a closed one opens after a moment under the dragged item. Try it — move a page within the list, into “Services”, or onto “My app” in the path; “Main menu” stands for the list’s own level and takes none:

My app Main menu waiting for glk-sort…
<glk-breadcrumbs group="pages"> <glk-breadcrumb value="app">My app</glk-breadcrumb> <glk-breadcrumb current>Main menu</glk-breadcrumb> </glk-breadcrumbs> <glk-list header="Main menu" sortable group="pages"> <glk-list-item title="Home"></glk-list-item> <glk-list-item title="Services" container></glk-list-item> <glk-list-item title="Contact"> <svg slot="handle" aria-hidden="true">...</svg> <!-- a pointer drags only here --> </glk-list-item> </glk-list> list.addEventListener('glk-sort', (event) => { const { item, from, to, target, position } = event.detail; // Not cancelled, the list moves the item itself. A page that renders // from its state cancels and renders the new order; the glide follows. event.preventDefault(); store.move(item.dataset.id, to.container, to.index).then(render); }); // The announcements in another language, at once list.messages = { roleDescription: 'sortierbar', instructions: 'Leertaste nimmt auf, Pfeiltasten verschieben, Leertaste legt ab, Escape bricht ab.', pickedUp: ({ label, position, size, container }) => `${label}, aufgenommen. Position ${position} von ${size} in ${container}.`, // moved, into, onto, dropped, cancelled };
AttributeComponentDescription
sortableglk-list, glk-treeThe items can be reordered
groupglk-list, glk-tree, glk-breadcrumbsA name: lists with the same one exchange items, trees too, and breadcrumbs with it take items from both
drop-targetglk-breadcrumbsThe crumbs take items from sortable lists and trees without a group; drop-target and group may change at run time
containerglk-list-item, glk-tree-itemTakes a dropped item inside it — a submenu
no-dragglk-list-item, glk-tree-itemStays where it is; the others still move around it
slot="handle"glk-list-item, glk-tree-itemA grip: a pointer starts a drag only there, a finger at once; Space still picks the item up on its row, so an <svg> will do

Keyboard: Space on an item picks it up, also where it has a handle (in a tree Enter still selects). Up and Down move it, Home and End to the ends; Right moves it into the item above, if that one takes items, Left out to the level above — from the top level onto the crumb of the level above —, both mirrored right to left. Space drops it, and the focus stays on it; Escape and Tab cancel. Every step is announced through a live region, and each item says how to move it.

In a shadow root (since 1.34.0): the item under the pointer is looked up in the root of each list or tree taking part, so a sortable list inside another element’s shadow root — the usual case in an app built of web components — takes drags by mouse and touch, and a group may span several roots. Until then only the keyboard sorted there. The folded levels of the “…” crumb take drops as well.

Items side by side (since 1.34.0) — the tiles of <glk-list grid>, or a layout of the page’s own — sort on the horizontal axis, mirrored right to left, with the line upright (GlassKit’s .is-sort-inline). Whether they stand side by side is read from the layout. The keyboard keeps the order of the items.

A sorter of the page’s own (since 1.34.0) uses the crumbs as drop targets too. dropTargetAt(x, y) on <glk-breadcrumbs> returns { item, index, current } for the crumb at a point of the viewport — item is its <glk-breadcrumb>, a folded level while the “…” menu is open —, { overflow: true } over “…”, or null. markDrop(target, { refused }) lights the crumb up while the drag is over it, or shows that it refuses the item; over “…” the menu opens after a moment, and markDrop(null) clears. The crumbs need drop-target or a group; the move on the drop is the page’s.

const crumbs = document.querySelector('glk-breadcrumbs'); // with drop-target or a group let target = null; board.addEventListener('pointermove', (e) => { if (!dragging) return; target = crumbs.dropTargetAt(e.clientX, e.clientY); // { item, index, current }, { overflow: true } or null crumbs.markDrop(target, { refused: target?.current }); // over "…" its menu opens after a moment }); board.addEventListener('pointerup', () => { if (target?.item) store.move(tile.dataset.id, target.item.value); // the move is the page's crumbs.markDrop(null); });

Events go to the element that owns the dragged item, each with via: 'mouse', 'touch' or 'keyboard'. glk-sort-start { item, from }; glk-sort-over { item, target, position } while the target changes, with position before, after or inside — cancelled, the target shows that it refuses the item, and a drop there does nothing; glk-sort { item, from, to, target, position } on the drop, cancelable and before anything moves, from and to as { container, index }; and glk-sort-cancel { item }, also for a drop back where the item came from. Not cancelled, the element moves the node itself; cancelled, the DOM is the page’s, which renders the new order from its state — the items glide into place either way. A drop on a crumb, or into a list’s container item, moves nothing: that level is not in the DOM, and the page moves the item there. The current crumb takes no drop from a list, since it stands for the list’s own level. If the page removes an item while it is dragged, the drag is cancelled.

Property messages on the list or tree translates the announcements: roleDescription and instructions are texts; pickedUp, moved, into, onto, dropped and cancelled are functions that get the label, the position, the size and the container. It applies at once, also to a list or tree that is sortable already. --gl-sort-duration (180 ms) and --gl-sort-easing (ease-out) time the glide; under prefers-reduced-motion nothing glides.

Build your own element

Since 1.14.0 the base classes are exported. A project element that extends GlkElement gets what every <glk-*> has: an open shadow root with GlassKit's stylesheet adopted (so .glass-btn & Co. work inside), the theme wrapper that follows data-theme and data-density, listeners re-armed when the element moves, and emit() for bubbling, composed events. GlkFormElement adds ElementInternals for native form participation. Try it — this button is a <demo-counter> defined on this page:

waiting for demo-count…
import { GlkElement } from '@jungherz-de/glasskit-elements'; class DemoCounter extends GlkElement { static get observedAttributes() { return ['count']; } render() { // this._wrapper is the themed root; GlassKit classes work inside this._btn = this.createElement('button', ['glass-btn', 'glass-btn--secondary', 'glass-btn--sm', 'glass-btn--auto']); this._wrapper.appendChild(this._btn); } setupEvents() { this._onClick = () => { this.count += 1; this.emit('demo-count', { count: this.count }); }; this._btn.addEventListener('click', this._onClick); } teardownEvents() { this._btn?.removeEventListener('click', this._onClick); } onAttributeChanged() { /* re-render the label */ } get count() { return Number(this.getAttribute('count')) || 0; } set count(v) { this.setAttribute('count', v); } } customElements.define('demo-counter', DemoCounter);
SetupImport
Bundle (ESM)import { GlkElement, GlkFormElement } from '@jungherz-de/glasskit-elements';
Per componentimport { GlkElement } from '@jungherz-de/glasskit-elements/base.js'; — the very module the components import, so instanceof GlkElement holds across both. The per-component files leave @jungherz-de/glasskit/glasskit-styles.js external: a bundler resolves it, an import map needs an entry for it. Never next to the <script> bundle — that carries its own copy of the class.
CDN / <script>const { GlkElement } = GlassKitElements;

Hooks: render() builds into this._wrapper; setupEvents() / teardownEvents() run on every connect / disconnect; onAttributeChanged(name, old, value) fires after the first render. Helpers: createElement(tag, classes, attrs), getBoolAttr() / setBoolAttr(), emit(name, detail). Return true from static get displayInline() for an inline element, and set static get observesLightDom() to have projectLightDom() re-run whenever light-DOM children change. Since 1.20.0, static get delegatesFocus() returning true hands the focus to the first field or button inside (on for GlkFormElement, and since 1.33.2 for <glk-button>, <glk-pill>, <glk-tab-item> and <glk-tab-accessory>), and a GlkFormElement whose get _validityField() returns its native field reports that field’s validity on the host after every setFormValue() and attribute change. Since 1.22.3, applyDisabled(disabled) hands the disabled state to the native controls: override it in a GlkFormElement. It runs after the first render and whenever the element’s own disabled or a <fieldset disabled> around it changes — no fieldset reaches into the shadow root by itself.

Building a complete website?

GlassKit Elements is the app layer of the GlassKit family – web components for application UIs. For complete marketing websites – sections, i18n, SEO – the intended path is GlassKit Web, the official Astro template built on the same design language. The pure-CSS foundation underneath both is GlassKit.