GlassKit Elements
Complete reference for all 24 web components – built by Jungherz GmbH. Vanilla JS, Shadow DOM, native form participation.
Installation
CDN (quickest)
npm
Selective Import
Import only what you need for smaller bundles:
Theming
Set data-theme on the <html> element. All components sync automatically via a shared MutationObserver.
Form Integration
All form components participate in native forms via ElementInternals.
Content Components
<glk-title>
Styled heading with text shadow.
<glk-badge>
Inline status badge with color variants.
| Attribute | Type | Values |
|---|---|---|
variant | String | primary | success | error |
<glk-avatar>
Circular avatar with initials or image.
| Attribute | Type | Values |
|---|---|---|
size | String | sm | (default) | lg |
src | String | Image URL |
<glk-card>
Glass-effect content card.
| Attribute | Type | Description |
|---|---|---|
glow | Boolean | Adds gradient glow effect |
<glk-divider>
<glk-status>
Status notice with message.
Buttons
<glk-button>
Glass-styled button with three variants and size options.
| Attribute | Type | Values |
|---|---|---|
variant | String | primary | secondary | tertiary |
size | String | sm | md | lg | auto |
disabled | Boolean | Disables the button |
type | String | button | submit | reset |
Events: glk-click
<glk-pill>
Small circular icon button (46x46px).
| Attribute | Type | Description |
|---|---|---|
label | String | Accessible aria-label |
disabled | Boolean | Disables the button |
Form Components
All form components support name, value, disabled and participate in native <form> submission.
<glk-input>
Text input with label, hint, and error state.
| Attribute | Type | Description |
|---|---|---|
label | String | Input label |
type | String | text, email, password, ... |
placeholder | String | Placeholder text |
hint | String | Helper text |
error | Boolean | Error styling |
required | Boolean | Required field |
Events: glk-input, glk-change
<glk-textarea>
<glk-select>
<glk-search>
<glk-toggle>
Switch toggle with form participation.
| Attribute | Type | Description |
|---|---|---|
label | String | Toggle label |
checked | Boolean | Checked state |
disabled | Boolean | Disabled state |
Events: glk-change → { checked: boolean }
<glk-checkbox>
<glk-radio>
<glk-range>
| Attribute | Type | Description |
|---|---|---|
min | Number | Minimum (default: 0) |
max | Number | Maximum (default: 100) |
value | Number | Current value |
step | Number | Step increment |
Feedback
<glk-progress>
| Attribute | Type | Values |
|---|---|---|
value | Number | 0 – 100 |
variant | String | success | error |
size | String | sm | (default) | lg |
<glk-modal>
Modal dialog with title, body, and action buttons.
Are you sure you want to proceed?
| Attribute | Type | Description |
|---|---|---|
open | Boolean | Show/hide |
title | String | Header title |
Methods: .show(), .close() Events: glk-close
<glk-toast>
Auto-dismissing notification.
| Attribute | Type | Values |
|---|---|---|
variant | String | success | error | warning |
duration | Number | ms (default: 3000) |
Methods: .show(message, variant, duration), .dismiss()
<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.
| Attribute | Type | Default | Description |
|---|---|---|---|
open | Boolean | false | Visibility state (reflected as .is-open on the inner surface) |
placement | String | bottom | top | bottom | start | end |
| Slot | Purpose |
|---|---|
trigger | Element that toggles the popover when clicked |
| (default) | Floating content shown while open |
Events: glk-open, glk-close
Methods: .show(), .close(), .toggle()
Heads-up: the method is deliberately called .toggle() — not .togglePopover(), which collides with the native HTMLElement.togglePopover() API.
Containers
<glk-accordion> + <glk-accordion-item>
Collapsible accordion sections.
| Attribute | Component | Description |
|---|---|---|
title | glk-accordion-item | Trigger text |
open | glk-accordion-item | Expanded state |
Events: glk-toggle → { open: boolean }
<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.
| Attribute | Component | Description |
|---|---|---|
header | glk-list | Section header text — uppercase label above the list |
flush | glk-list | Edge-to-edge variant — removes side margin and radius |
bare | glk-list | Strips background, border, shadow — for embedding inside <glk-popover> or <glk-card> |
title | glk-list-item | Primary text |
subtitle | glk-list-item | Secondary text (muted, optional) |
interactive | glk-list-item | Hover / focus / active states + emits glk-click |
center | glk-list-item | Centered single-text variant (e.g. for action rows) |
leading-lg | glk-list-item | Large 40×40 leading icon with rounded corners (for app icons) |
wrap | glk-list-item | Multi-line subtitle (up to 3 lines with ellipsis) |
detail | glk-list-item | Muted trailing value text (e.g. file size, version) |
variant | glk-list-item | danger (red destructive) or accent (primary color) |
| Slot | Component | Purpose |
|---|---|---|
leading | glk-list-item | Icon slot (24×24 SVG, or 32×32 with leading-lg) |
trailing | glk-list-item | Chevron, badge, or button (rendered after detail value) |
Events: glk-click on <glk-list-item> when interactive is set.
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.