GlassKit Elements
Vollständige Referenz für alle 24 Web Components – entwickelt von Jungherz GmbH. Vanilla JS, Shadow DOM, native Formular-Teilnahme.
Installation
CDN (schnellste Variante)
npm
Selektiver Import
Importieren Sie nur, was Sie benötigen, für kleinere Bundles:
Theming
Setzen Sie data-theme auf dem <html>-Element. Alle Komponenten synchronisieren sich automatisch über einen gemeinsamen MutationObserver.
Formular-Integration
Alle Formular-Komponenten nehmen über ElementInternals an nativen Formularen teil.
Inhalts-Komponenten
<glk-title>
Gestaltete Überschrift mit Textschatten.
<glk-badge>
Inline-Status-Badge mit Farbvarianten.
| Attribute | Type | Values |
|---|---|---|
variant | String | primary | success | error |
<glk-avatar>
Kreisförmiger Avatar mit Initialen oder Bild.
| Attribute | Type | Values |
|---|---|---|
size | String | sm | (default) | lg |
src | String | Image URL |
<glk-card>
Inhaltskarte mit Glaseffekt.
| Attribute | Type | Description |
|---|---|---|
glow | Boolean | Adds gradient glow effect |
<glk-divider>
<glk-status>
Statushinweis mit Nachricht.
Buttons
<glk-button>
Glas-gestalteter Button mit drei Varianten und Größenoptionen.
| 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>
Kleiner kreisförmiger Icon-Button (46x46px).
| Attribute | Type | Description |
|---|---|---|
label | String | Accessible aria-label |
disabled | Boolean | Disables the button |
Formular-Komponenten
Alle Formular-Komponenten unterstützen name, value, disabled und nehmen an der nativen <form>-Übermittlung teil.
<glk-input>
Textfeld mit Label, Hinweis und Fehlerzustand.
| 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>
Schalter-Toggle mit Formular-Teilnahme.
| 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>
Modaler Dialog mit Titel, Inhalt und Aktions-Buttons.
Sind Sie sicher, dass Sie fortfahren moechten?
| Attribute | Type | Description |
|---|---|---|
open | Boolean | Show/hide |
title | String | Header title |
Methods: .show(), .close() Events: glk-close
<glk-toast>
Automatisch ausblendende Benachrichtigung.
| Attribute | Type | Values |
|---|---|---|
variant | String | success | error | warning |
duration | Number | ms (default: 3000) |
Methods: .show(message, variant, duration), .dismiss()
Container
<glk-accordion> + <glk-accordion-item>
Einklappbare Akkordeon-Abschnitte.
| Attribute | Component | Description |
|---|---|---|
title | glk-accordion-item | Trigger text |
open | glk-accordion-item | Expanded state |
Events: glk-toggle → { open: boolean }