Deterministic styling for high-performance web interfaces.
Rust-native CSS compilation with explicit cascade layers, plus optional components, motion, and graphics packages for interactive interfaces.
Dynamic Motion Personalities & 4 Navigation Patterns
Test real-time motion physics and switch responsive navigation modes live across your device viewports with zero page reloads.
Global Motion Personality
body.cyn-motion-smooth
Controls duration, spring overshoot, and easing across all overlays, dialogs, dropdowns, and view transitions.
Header Navigation Pattern
.nav-pattern-ribbon
Single class selection on <header class="navbar ..."> to adapt mobile layout ergonomics.
Coheryn CSS Engine
An incremental Rust compiler organizes CSS into explicit @layer cyn.* layers. Browser interaction packages are optional.
Accessible Primitives
Complete suite of focus-trapped dialogs, mobile bottom sheets, drawers, popovers, and toasts with WCAG 2.2 AA compliance.
GPU Materials & Shaders
3-tier optical hierarchy: WebGPU WGSL shaders, WebGL2 fragment pipelines, and graceful CSS backdrop-blur fallback.
Quick Installation & Agent Skills
Package SetupInstall the client runtime packages or initialize your preferred coding agent in one command:
$ pnpm add @coheryn/coherynui-react @coheryn/coherynui-components
$ coherynui agent init --client all
Interactive HTML & CSS Preview
Edit markup and preview CoherynUI classes in your browser. The CSS panel illustrates supported styles; use the native CLI to compile your project.
/* Illustrative CSS will appear here */
W3C Cascade Layer Ordering Architecture
CoherynUI eliminates specificity wars and !important hacks by enforcing strict W3C @layer precedence.
Layer Precedence Hierarchy (Lowest to Highest)
For normal layered declarations, later layers take precedence over earlier layers. Unlayered styles and important declarations have different precedence. Click a layer to inspect:
Atomic utility classes (e.g. .bg-brand, .p-6, .touch-target)
Multi-property component patterns (.modal-dialog, .glass-card)
Global typography, root styles, focus-visible outlines
Custom property tokens (--cyn-brand, --cyn-touch-min)
Normalized box-sizing, margin/padding baseline reset
Layer Details: cyn.utilities
Specification Contract
The cyn.utilities layer holds generated atomic classes. Because it has the highest precedence, applying class="btn-primary p-8" will override any padding defined inside .btn-primary without needing !important.
@layer cyn.utilities {
.bg-brand { background-color: var(--cyn-color-brand); }
.p-6 { padding: 1.5rem; }
.touch-target { min-width: 44px; min-height: 44px; }
.touch-none { touch-action: none; }
}
Live Design Token Inspector
Modify CSS custom properties in real time to observe instant live cascade propagation.
Token Overrides
#6366f1)
--cyn-color-brand
--cyn-radius-lg
--cyn-glass-blur
--cyn-card-shadow
Dynamic Surface Token Binding
This container responds instantly to custom property mutations without re-rendering DOM elements or reloading stylesheets.
:root {
--cyn-color-brand: #6366f1;
--cyn-radius-lg: 12px;
--cyn-glass-blur: 16px;
}
Accessible Component Workbench
Explore keyboard and focus-management patterns for interactive components. Test accessibility in the application and browsers you ship.
UI Components vs. Native Web Components
UI Components (This Tab): Standard semantic HTML5 + W3C @layer cyn.recipes CSS + optional React bindings (@coheryn/coherynui-react). Operates with 0 kB mandatory JavaScript runtime. Styled via pure cascade classes like .cyn-navbar, .modal-box, and .btn.
Web Components (Next Tab): W3C Custom Elements (<cyn-modal>, <cyn-navbar>) powered by @coheryn/coherynui-web-components. Includes autonomous DOM encapsulation, two-way attribute reflection, lifecycle hooks, and universal support across Vue, Svelte, Angular, Solid, PHP, Django, and Vanilla HTML without React.
Accessible Dialog Modal
Traps Tab/Shift-Tab focus, locks body scroll, and dismisses on Escape or backdrop click.
<!-- Accessible Focus-Trapped Modal -->
<div class="modal-backdrop" id="demoModal" role="dialog" aria-modal="true">
<div class="modal-box">
<h3 class="card-title-lg">Dialog Modal</h3>
<p class="modal-desc">Focus trapped inside dialog.</p>
<button class="btn btn-primary" onclick="closeModal()">Confirm</button>
</div>
</div>
Tactile Mobile BottomSheet
Mobile-first slide-up drawer with tactile drag handle, touch-action isolation, and pull-down dismiss.
<!-- Mobile Tactile BottomSheet -->
<div class="bottomsheet-backdrop" id="demoSheet" role="dialog" aria-modal="true">
<div class="bottomsheet-box">
<div class="bottomsheet-handle"></div>
<h3 class="card-title-lg">Tactile Drawer</h3>
<button class="btn btn-primary w-full" onclick="closeBottomSheet()">Done</button>
</div>
</div>
Slide-In Side Drawer
Slide-in side navigation and configuration panel with smooth cubic-bezier transitions.
<!-- Slide-In Side Drawer Overlay -->
<div class="drawer-backdrop" id="demoDrawer" role="dialog" aria-modal="true">
<div class="drawer-box">
<h3 class="card-title-lg">System Drawer</h3>
<button class="btn btn-primary w-full" onclick="closeDrawer()">Close</button>
</div>
</div>
Anchored Popover
Anchored floating card with pointer click outside dismissal and keyboard escape listener.
Popover Details
Anchored to trigger element with automated click-outside detection.
<!-- Anchored Popover Container -->
<div class="popover-anchor">
<button class="btn btn-secondary" onclick="togglePopover()">Toggle</button>
<div class="popover-card" id="myPop">
<h4>Popover Title</h4>
</div>
</div>
Roving Focus Menu
Accessible action menu with roving keyboard focus (↑/↓/Enter) and danger state actions.
<!-- Roving Keyboard Focus Dropdown -->
<div class="popover-anchor">
<button class="btn btn-primary" onclick="toggleDropdown()">Menu ▼</button>
<div class="dropdown-box" id="myDrop">
<button class="dropdown-item">Edit Profile</button>
<button class="dropdown-item danger">Revoke</button>
</div>
</div>
Stackable Notifications
Real-time notifications with accessible role="status", auto-dismiss timers, and variants.
<!-- Real-Time Notification Stack -->
<div class="toast-stack" id="toastStack">
<div class="toast-node success" role="status">
<span>✓</span>
<div><h4>Build Succeeded</h4><p>Zero runtime overhead.</p></div>
</div>
</div>
Bordered & Lifted Folder Tabs (`.cyn-tabs-lifted`)
Supports classic lifted folder tabs, pill badges, and underline navigation with WCAG 2.2 roving focus and seamless baseline integration.
1 Step
This is the 1 Step tab content.
2 Step
This is the 2 Step tab content.
3 Step
This is the 3 Step tab content.
<!-- Bordered / Lifted Folder Tabs (.cyn-tabs-lifted) -->
<div class="cyn-tabs cyn-tabs-lifted" id="stepTabs">
<div class="cyn-tablist" role="tablist">
<button class="cyn-tab-btn" role="tab" aria-selected="false" aria-controls="step1">1 Step</button>
<button class="cyn-tab-btn active" role="tab" aria-selected="true" aria-controls="step2">2 Step</button>
<button class="cyn-tab-btn" role="tab" aria-selected="false" aria-controls="step3">3 Step</button>
</div>
<div class="cyn-tabpanel active" id="step2" role="tabpanel">
<h3>2 Step</h3>
<p>This is the 2 Step tab content.</p>
</div>
</div>
Focus Ring System & Child Dividers
Compound box-shadow focus rings that never shift layout boundaries, paired with automatic child divider borders.
<!-- Non-Layout-Shifting Accessible Focus Ring -->
<button class="btn ring-2 ring-brand ring-offset-2">Action</button>
<!-- Automatic Child Dividers -->
<div class="divide-y divide-subtle">
<div class="py-2">Row 1</div>
<div class="py-2">Row 2</div>
</div>
Prose Typography Engine
Automated proportional typography with balanced line-heights for documentation, articles, and release notes.
Deterministic Design Standards
Use explicit cascade layers to organize styles. Press ⌘K for quick command lookup.
"Explicit layers make style precedence easier to inspect."
| Layer | Order | Status |
|---|---|---|
cyn.base |
3 / 5 | Active |
cyn.recipes |
4 / 5 | Optimized |
<!-- Proportional Markdown Typography -->
<article class="cyn-prose">
<h2>Title</h2>
<p>Paragraph with <a href="#">link</a> and <code>token</code>.</p>
<blockquote>Direct citation.</blockquote>
</article>
Form Controls & Validation
Normalized native inputs, error indicators, custom select chevrons, styled checkboxes, and radio groups.
<!-- Normalized Form Group with Validation -->
<div class="cyn-form-group">
<label class="cyn-form-label" for="email">Email</label>
<input class="cyn-form-input is-invalid" id="email" type="email" />
<span class="cyn-form-error">Invalid email format.</span>
</div>
<!-- Styled Select Dropdown & Checkbox -->
<select class="cyn-form-select"><option>Production</option></select>
<input class="cyn-form-checkbox" type="checkbox" checked />
Declarative JavaScript Assist (`@coheryn/coherynui-js-assist`)
CoherynUI is CSS-first. For full WCAG 2.2 Level AA accessibility (focus trapping, roving arrow navigation, outside-click and escape dismissal, focus restoration) without writing imperative JavaScript, include the optional assist script.
<!-- 1. Declarative Trigger -->
<button class="btn btn-primary" data-cyn-toggle="modal" data-cyn-target="#myModal">
Open Modal
</button>
<!-- 2. Accessible Target (Focus trapped, ESC dismissed, Focus restored) -->
<div class="modal-backdrop" id="myModal" role="dialog" aria-modal="true" aria-hidden="true">
<div class="modal-box">
<button class="modal-close-btn" data-cyn-dismiss="modal">✕</button>
<h3>Progressive Assist Modal</h3>
<p>Keyboard focus cycling and scroll-lock example.</p>
<button class="btn btn-secondary" data-cyn-dismiss="modal">Close</button>
</div>
</div>
<!-- 3. Optional Script (~2.5 kB brotli) -->
<script src="coherynui-assist.min.js" defer></script>
Native Web Component Custom Elements
Standardized, zero-runtime-overhead custom elements powered by @coheryn/coherynui-web-components.
Operates universally across Vanilla HTML/JS, Vue, Svelte, Angular, Solid, PHP, Django, and Rails without requiring React or any external build dependencies.
Features full attribute synchronization, two-way state reflection, and real-time custom events.
Dialog Custom Element
Native dialog with focus trapping, scroll locking, and Escape/backdrop dismissal.
<cyn-modal id="myModal" title="Confirm">
<p>Accessible custom element modal.</p>
</cyn-modal>
Slide-In Drawer Element
Slide-in side navigation panel with smooth transitions and scroll locking.
<cyn-drawer id="myDrawer" placement="right">
<h3>Side Panel</h3>
</cyn-drawer>
BottomSheet Element
Mobile-first pull-down sheet with tactile drag handle and touch target sizing.
<cyn-bottom-sheet id="mySheet">
<h3>Tactile Mobile Sheet</h3>
</cyn-bottom-sheet>
Accessible Switch Element
ARIA role="switch", keyboard spacebar toggle, and cyn-change custom event.
<cyn-switch label="Dark Mode" checked></cyn-switch>
Floating Overlays
Contextual floating menus and popovers with automated outside-click dismissal.
Custom Element Info
Anchored floating card managing outside-click dismissal automatically.
<cyn-dropdown>
<button class="btn btn-primary">Menu</button>
<div class="dropdown-box">...</div>
</cyn-dropdown>
Toast Stack Element
Declarative notification stack responding to element pushToast API calls.
<cyn-toast-container id="toasts"></cyn-toast-container>
Accessible Tabs Element
Autonomous roving keyboard focus (Left/Right arrows, Home/End), ARIA attribute reflection, and cyn-change telemetry events with variant="lifted" | "pills" | "line".
GPU-accelerated design tokens with native HDR color spaces (Display-P3).
Display-P3 ReadyAn example of layered visual effects. Rendering performance depends on the browser, device, and workload.
Animation ExampleExample keyboard patterns inspired by accessibility guidance. Review and test the complete interface before release.
Accessibility Example<cyn-tabs>
<div role="tablist" class="cyn-tablist">
<button role="tab" class="cyn-tab-btn active" aria-selected="true">Overview</button>
<button role="tab" class="cyn-tab-btn" aria-selected="false">Details</button>
</div>
<div role="tabpanel" class="cyn-tabpanel active">Overview content</div>
<div role="tabpanel" class="cyn-tabpanel">Details content</div>
</cyn-tabs>
Framework Integration Guides
Setup PatternsUse CoherynUI Custom Elements in any modern JavaScript framework or server-rendered architecture with standard HTML syntax.
<!-- Copy the bundled coherynui.css file into your project. -->
<link rel="stylesheet" href="/static/build/3146eea57f87783274a70d11878f9325ea5c5f5e1dfb81ceeeae7c61505c3494/playground/coherynui.css">
<!-- Native HTML dialog; no component package required. -->
<dialog id="myModal" aria-labelledby="modalTitle">
<h2 id="modalTitle">System Confirmation</h2>
<p>This example uses the browser's native dialog behavior.</p>
<form method="dialog">
<button class="btn btn-primary">Confirm</button>
</form>
</dialog>
<button class="btn btn-primary"
onclick="document.getElementById('myModal').showModal()">
Open Modal
</button>
// vite.config.ts - Allow cyn-* custom elements
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('cyn-')
}
}
})
]
})
<!-- App.vue -->
<script setup>
import '@coheryn/coherynui-web-components';
import { ref } from 'vue';
const isGpuActive = ref(true);
function onSwitchChange(event) {
isGpuActive.value = event.detail.checked;
}
</script>
<template>
<cyn-switch label="Hardware Acceleration" :checked="isGpuActive" @cyn-change="onSwitchChange" />
</template>
// app.module.ts - Enable CUSTOM_ELEMENTS_SCHEMA
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@coheryn/coherynui-web-components';
@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {}
<!-- app.component.html -->
<cyn-modal #modal title="Angular Security Dialog">
<p>Seamlessly integrated with Angular template reference variables.</p>
<button class="btn btn-primary" (click)="modal.close()">Save</button>
</cyn-modal>
<button class="btn btn-primary" (click)="modal.show()">Open Modal</button>
<!-- App.svelte -->
<script>
import '@coheryn/coherynui-web-components';
let isChecked = true;
function handleChange(e) {
isChecked = e.detail.checked;
}
</script>
<cyn-switch label="Dark Theme" checked={isChecked} on:cyn-change={handleChange} />
<cyn-modal id="svelteModal" title="Svelte Dialog">
<p>Native W3C Custom Element running in Svelte 5.</p>
</cyn-modal>
Analytical Spring Dynamics Laboratory
Second-order unforced damped harmonic oscillator: m·x'' + c·x' + k·x = 0.
Spring Parameters
Click 'Trigger Impulse' or drag the element to evaluate spring equilibrium restoration.
Universal Motion Tokens & Body Personalities
Zero-runtime CSS variables driving smooth animations across all dialogs, drawers, dropdowns, and view transitions. Switch global physics with a single class on <body>, or use modular transition classes on any element.
1. Global Body Personalities
<!-- Apply to <body> for global physics -->
<body class="cyn-motion-spring"> <!-- 300ms spring -->
<body class="cyn-motion-smooth"> <!-- 220ms curve -->
<body class="cyn-motion-subtle"> <!-- 120ms fade -->
<body class="cyn-motion-none"> <!-- 0ms instant -->
Dynamically adjusts --cyn-transition-duration, --cyn-transition-fn, and --cyn-motion-scale-enter.
2. Transition Utility Classes
<!-- Per-element transition classes -->
<div class="cyn-transition-scale">...</div>
<div class="cyn-transition-fade">...</div>
<div class="cyn-transition-slide-up">...</div>
<ul class="cyn-stagger-list">
<li>Child 1</li>
<li>Child 2</li>
</ul>
Combine with origins: .cyn-origin-top-left, .cyn-origin-center.
3. W3C View Transitions
// Trigger smooth W3C View Transition
if (document.startViewTransition) {
document.startViewTransition(() => {
updateDomState();
});
}
Leverages cynViewExit and cynViewEnter keyframes with token timing.
GPU Materials & Liquid Glass Refraction
3-tier optical hierarchy with automatic fallback to CSS Liquid Glass and reduced-transparency safety.
Liquid Glass Refraction
Specular chromatic border with dual-pass blur and dynamic normal-map displacement.
Pure CSS Liquid Glass Recipe
Optical MaterialPhysical glass surface with dual-pass blur, chromatic edge reflection, and automatic fallback for reduced-transparency environments:
/* Physical Liquid Glass Recipe */
.glass-card {
background: rgba(15, 23, 42, 0.72);
backdrop-filter: blur(var(--cyn-glass-blur, 16px));
-webkit-backdrop-filter: blur(var(--cyn-glass-blur, 16px));
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: var(--cyn-radius-lg, 12px);
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
}
@media (prefers-reduced-transparency: reduce) {
.glass-card {
background: #0f172a;
backdrop-filter: none;
}
}
Agent & MCP Integration Portal
Machine-readable registry APIs and official Model Context Protocol tools for AI pair programming.
10 MCP Server Tools
Run coherynui mcp serve over stdio to enable coding agents to inspect projects safely:
project_inspect: Identify compiler, config, and theme profilesdocs_search: Semantic search across versioned documentationcomponents_search: Query components by intent and capabilitycomponents_get: Retrieve props, accessibility, and examplesrecipes_search: Search layout and material recipesthemes_list: Enumerate tokens and customization hooksstyles_explain: Explain classes and cascade layer resolutioncode_validate: Return structured compiler diagnosticsproject_plan: Propose implementation steps safelymigration_analyze: Plan migrations from legacy CSS engines
Multi-Client Agent Initialization
Initialize canonical rules and 7 official skills with one command:
# Initialize Claude Code, Cursor, Copilot & Codex
coherynui agent init --client all
# Install 7 canonical offline skills
coherynui agent skills install
MCP Stdio Configuration
// claude_desktop_config.json or .cursor/mcp.json
{
"mcpServers": {
"coherynui": {
"command": "coherynui",
"args": ["mcp", "serve"]
}
}
}