Framework · v0.1.0 · MIT License

Every corner
is a parallelogram.

Tokamak is a web component library built on two structural rules. No framework required. Drop one script tag and use custom elements anywhere.

Two rules.

The entire visual language collapses to a pair of geometric constraints. Everything else follows.

Rule 01
All 4-cornered surfaces
are parallelograms.

Buttons, inputs, cards, badges, nav items, tabs, progress bars. No exceptions. skewX(-14deg) on the shell. Content counter-skewed to stay upright.

Rule 02
Large containers have
one circular leading edge.

Panels, drawers, dialogs. A circle of radius 80vh forms the left boundary. Overflow clipped to viewport — the hard cut is the design.

Component surface

10 components. Native custom elements. No build step, no dependencies, no framework lock-in.

Element Description Status
Getting Started

Installation

One script tag. Works in any HTML page, React app, Vue project, or static site.

CDN

The fastest way to get started. Paste this before your closing </body> tag.

HTML
<script src="https://cdn.tokamak-ui.ereneksi.com/tokamak.min.js"></script>
npm
npm install tokamak-ui
import 'tokamak-ui'; // registers all custom elements
Dark mode

Add data-theme="dark" to your root element to switch all components to dark mode simultaneously.

<html data-theme="dark"> // all components adapt automatically
Fonts

Tokamak uses JetBrains Mono exclusively. The CDN bundle injects it automatically. For npm installs, add this to your <head>.

<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700" rel="stylesheet">
Foundation

Design Tokens

All values exposed as CSS custom properties on :root. Override any token to theme your instance.

Color
Grayscale primitives
Semantic tokens
TokenLightDarkRole
--tok-bg#ffffff#080808Page / canvas
--tok-bg-2#f2f2f2#111111Surface / card
--tok-bg-3#e4e4e4#1c1c1cElevated / hover
--tok-fg#080808#f2f2f2Primary text
--tok-fg-2#555555#888888Secondary / muted
--tok-fg-3#999999#3a3a3aPlaceholder / subtle
--tok-border#c8c8c8#242424Default border
--tok-border-hi#080808#f2f2f2Active / focus
Geometry
TokenValueUsage
--tok-skew-14degParallelogram angle — all shells
--tok-panel-radius80vhPanel circular edge radius
Animation
TokenValue
--tok-ease-springcubic-bezier(0.16, 1, 0.3, 1)
--tok-ease-outcubic-bezier(0, 0, 0.2, 1)
--tok-duration-fast120ms
--tok-duration-base220ms
--tok-duration-slow420ms
--tok-duration-panel420ms
Component

tok-button

A parallelogram button. Four variants, three sizes, disabled state. Emits a tok-click custom event.

Variants
<tok-button>Primary</tok-button> <tok-button variant="secondary">Secondary</tok-button> <tok-button variant="ghost">Ghost</tok-button> <tok-button variant="danger">Danger</tok-button> <tok-button disabled>Disabled</tok-button>
Sizes
<tok-button size="sm">Small</tok-button> <tok-button>Medium</tok-button> <tok-button size="lg">Large</tok-button>
Props
AttributeTypeDefaultOptions
variantstring"primary"primary secondary ghost danger
sizestring"md"sm md lg
disabledbooleanPresence disables
Events
EventDetail
tok-clickFired on click when not disabled. Bubbles.
Component

tok-badge

Inline status indicator. Three variants. Always a parallelogram, content auto-counter-skewed.

Variants
Stable Beta Deprecated New v0.1.0
<tok-badge>Stable</tok-badge> <tok-badge variant="outline">Beta</tok-badge> <tok-badge variant="muted">Deprecated</tok-badge>
Props
AttributeTypeDefaultOptions
variantstring"solid"solid outline muted
Component

tok-input

Text input and select wrapped in a parallelogram shell. Focus triggers a border highlight. Use with tok-field for labelled form groups.

Input
<tok-field label="API Endpoint"> <tok-input placeholder="https://..."></tok-input> </tok-field> <tok-field label="Environment"> <tok-select> <option>production</option> <option>staging</option> </tok-select> </tok-field>
Props — tok-input
AttributeTypeNotes
placeholderstringForwarded to the inner <input>
valuestringSettable via JS property
Events
EventDetail
tok-input{ value: string } — fires on every keystroke. Bubbles.
tok-change{ value: string } — fires on blur / select change. Bubbles.
Component

tok-toggle

A parallelogram toggle switch with an optional label. Spring-animated thumb. Controlled or uncontrolled.

Enable telemetry
Dark mode
Read-only setting
<tok-toggle label="Enable telemetry"></tok-toggle> <tok-toggle label="Dark mode" checked></tok-toggle>
Props
AttributeTypeDefault
labelstring
checkedboolean
Events
EventDetail
tok-change{ checked: boolean }. Bubbles.
Component

tok-checkbox

Parallelogram checkbox and radio group. Check mark is counter-skewed to appear upright.

Checkbox
Auto-deploy on push
Send failure alerts
Enable canary rollout
Radio
Production
Staging
Development
<tok-checkbox label="Auto-deploy on push" checked></tok-checkbox> <tok-radio-group name="env"> <tok-radio value="production" checked>Production</tok-radio> <tok-radio value="staging">Staging</tok-radio> </tok-radio-group>
Component

tok-card

Surface container with parallelogram border shell. Hover darkens the border. Supports an optional badge.

Uptime
99.98% over the last 30 days across all regions.
New
Latency
42ms average P50 response time.
Requests
1.4M requests served this week.
<tok-card title="Uptime" body="99.98% over 30 days." ></tok-card> <tok-card title="Latency" body="42ms average." badge="new" ></tok-card>
Props
AttributeTypeNotes
titlestringBold heading
bodystringMuted description text
badgestringOptional solid badge label above title
Component

tok-tabs

Parallelogram tab strip. Active tab has a full-bleed bottom border. Emits tok-change with the selected tab label.

// panel content
<tok-tabs tabs="Overview,Tokens,Components"></tok-tabs> // Listen for changes document.querySelector('tok-tabs') .addEventListener('tok-change', e => { console.log(e.detail.tab); // 'Tokens' });
Props
AttributeTypeNotes
tabsstringComma-separated list of tab labels
activestringInitially selected tab (defaults to first)
Component

tok-progress

Parallelogram progress bar. Animated fill. Label and percentage shown below.

Build72%
Test coverage41%
Bundle optimised95%
<tok-progress value="72" label="Build"></tok-progress>
Props
AttributeTypeNotes
valuenumber (0–100)Fill percentage
labelstringDescription shown below-left
Component

tok-panel

Drawer panel with a circular leading edge. A 160vh circle forms the left boundary, clipped at viewport edges — the sharp cut is intentional.

<tok-panel id="settings"> <span slot="title">Settings</span> <!-- content --> </tok-panel> // JS document.querySelector('#settings').open();
Methods
MethodDescription
.open()Opens the panel with spring animation
.close()Closes the panel
.toggle()Toggles open/closed state
Slots
SlotDescription
(default)Panel body content
titlePanel heading text
subtitlePanel description text
Reference

Changelog

All notable changes. Follows Keep a Changelog.

v0.1.0
May 2026 — Initial release
  • 10 custom elements: tok-button, tok-badge, tok-input, tok-select, tok-field, tok-toggle, tok-checkbox, tok-card, tok-tabs, tok-progress
  • Full Shadow DOM encapsulation per component
  • Dark mode via data-theme="dark" on root
  • Spring-eased animations on all interactive elements
  • Design tokens exported as tokamak.css and tokens.json
  • Zero runtime dependencies
Planned — v0.2.0
Roadmap
  • tok-panel web component (currently CSS-only)
  • tok-accordion, tok-toast, tok-pagination
  • tok-navbar and tok-breadcrumb
  • tok-table with sortable columns
  • Headless mode (logic-only, no styles) for custom theming
  • React wrapper package (@tokamak-ui/react)
  • Figma token sync via Style Dictionary
  • Docs hosted at tokamak-ui.ereneksi.com
Configuration

Adjust your deployment settings. Changes take effect on the next build.

Enable telemetry
Quickstart

Up and running in 60 seconds.

1. Add the script
<script src="https://cdn.tokamak-ui.ereneksi.com/tokamak.min.js"></script>
2. Use the elements
<tok-button>Click me</tok-button> <tok-card title="Hello" body="World"></tok-card>
3. Dark mode
<html data-theme="dark">