v1.0.168 elementsShadow DOMVanilla JSNotionKit CSS 1.1.1MIT

The NotionKit look, as elements.

68 vanilla-JS Web Components wrapping the NotionKit CSS foundation: same word stem, same tokens, Shadow DOM, automatic light/dark sync, native form participation โ€“ and pixel parity with the class markup, measured in both themes.

Read the docs Open the demo app Showcase

The reference app

The NotionKit demo app, rebuilt from elements only โ€“ 0.00 % pixel difference to the class version on desktop.

Same look, a fraction of the markup

Before โ€“ .nk-* classes

Email notifications
Shown next to your comments.
๐Ÿ’ก
A callout carries one thought that must not be missed.
๐Ÿš€NotionKit MVP๏ผ‹โ‹ฏ
<div class="nk-field">
  <div><div class="f-label">Email notifications</div><div class="f-desc">Shown next to your comments.</div></div>
  <div class="f-control"><button class="nk-switch" role="switch" aria-checked="true"></button></div>
</div>
<div class="nk-callout"><span class="c-icon">๐Ÿ’ก</span><div>A callout carries one thought that must not be missed.</div></div>
<div class="nk-tree-item active"><span class="icon">๐Ÿš€</span><span class="label">NotionKit MVP</span><span class="actions"><span>๏ผ‹</span><span>โ‹ฏ</span></span></div>

After โ€“ one element

A callout carries one thought that must not be missed. NotionKit MVP
<nk-field label="Email notifications" desc="Shown next to your comments."><nk-switch checked></nk-switch></nk-field>
<nk-callout icon="๐Ÿ’ก">A callout carries one thought that must not be missed.</nk-callout>
<nk-tree-item icon="๐Ÿš€" active>NotionKit MVP</nk-tree-item>
๐Ÿงฉ
Same word stem

.nk-callout becomes <nk-callout>; a modifier class becomes an attribute, a state class a boolean attribute.

๐ŸŽฏ
Pixel parity

Every element renders identically to its class markup โ€“ checked by a Playwright pixel test in light and dark.

๐ŸŒ—
One theme source

data-theme on <html>; one observer mirrors it into every element. Brand once on :root, all elements follow.

๐Ÿ“
Real forms

Inputs, selects, switches, checks, radios and sliders take part in FormData, reset and validation.

๐Ÿ—ƒ๏ธ
Data views

Give <nk-database> columns and rows; get a table and a board with polymorphic cells and drag & drop.

โŒ˜
Overlays that behave

Settings modal, โŒ˜K palette, menus, popovers and toasts with focus handling, inert and keyboard support.

Quick start

Load NotionKit CSS and the elements bundle
Put class="nk-body" on <body>
Write elements
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.1.1/notionkit.min.css">
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.0.1/dist/notionkit-elements.min.js"></script>

<body class="nk-body">
  <nk-callout icon="๐Ÿ’ก">A callout carries one thought that must not be missed.</nk-callout>
</body>

The NotionKit family