# Skynet UI — LLM reference (v3.0.0)
Paste this file into an LLM conversation (or keep it in the repo as context) so the model can generate correct Skynet UI markup.
RULES FOR GENERATION:
- Pure CSS + vanilla JS framework. Include with: `` and `` (local copies), or from the CDN: `https://skynetui.com/v3.0.0/skynet-ui.css` and `https://skynetui.com/v3.0.0/skynet-ui.js` (minified: `skynet-ui.min.css`/`.min.js`; SRI hashes at `/v3.0.0/sri.txt`; pin a version; bare `https://skynetui.com/skynet-ui.css` = latest). Always include ``.
- Dark theme is the default; no class needed. Built-in alternatives via `data-theme` on `` — dark family: `"midnight"` (OLED black + cyan), `"forest"` (deep green + emerald), `"dusk"` (violet + fuchsia), `"contrast"` (max-legibility black/white/yellow); light family: `"light"`, `"paper"` (warm cream + amber), `"sky"` (cool blue + azure), `"rose"` (blush + rose). `"auto"` follows the OS. Density: `data-density="compact"` on or a container tightens paddings. Custom themes = another `[data-theme="x"]{…}` block overriding :root vars (include color-scheme and --sk-primary-text).
- Components are prefixed `sk-`. Utilities are short and unprefixed (`flex`, `p-4`, `mt-6`, `text-muted`).
- Interactive behavior is declarative via `data-sk-*` attributes; never write custom JS for modals/tabs/dropdowns/toasts/mobile nav.
- Mobile-first: `.sk-grid` is 1 column on phones; `sk-cols-*` add columns at ≥640px/≥1024px. Navbar collapses behind a `data-sk-burger` button; sidebar slides in via a `data-sk-sidebar` button.
- Spacing scale: number × 0.25rem (`4` = 1rem), same as Tailwind. Steps 0–8 everywhere, plus 5/10/12/16/20/24 on common axes (see Tailwind-compat additions below).
- Utilities include a Tailwind-compat layer (grid-cols-*, space-y-*, w-1/2, sm:/md:/lg: variants for a listed set, line-clamp, sr-only, …) — see "Tailwind-compat additions" and the conversion guide at the end of this file.
- Do not invent class names not listed here.
- AI agents can also consume this framework via MCP: streamable-HTTP server at https://skynetui.com/mcp (tools: get_reference, get_example). Example pages: https://skynetui.com/examples/{dashboard|chat|auth}.html
## CSS variables (in :root — override to theme)
--sk-bg #0b0f17 page bg | --sk-surface #111826 cards/nav | --sk-surface-2 #172033 hover/inputs-on-cards | --sk-border #1e2836 subtle border | --sk-border-2 #2a3547 stronger border
--sk-text #e6eaf2 main | --sk-text-2 #aeb7c7 secondary | --sk-muted #8b95a7 | --sk-faint #5b6474 placeholder
--sk-primary #6366f1 | --sk-primary-hover #4f52e0 | --sk-primary-soft rgba(99,102,241,.15)
--sk-success #16a34a / --sk-success-text #4ade80 / --sk-success-soft | --sk-warning #d97706 / --sk-warning-text #fbbf24 / --sk-warning-soft | --sk-danger #dc2626 / --sk-danger-hover / --sk-danger-text #f87171 / --sk-danger-soft | --sk-info #0ea5e9 / --sk-info-text #38bdf8 / --sk-info-soft
--sk-radius 10px | --sk-radius-sm 7px | --sk-radius-lg 16px | --sk-shadow | --sk-shadow-lg | --sk-transition .18s ease
--sk-font | --sk-font-mono | --sk-container 1140px | --sk-navbar-height 60px | --sk-sidebar-width 250px
## JS API (global, from skynet-ui.js)
skToast(message, type?, durationMsOrOpts?) — type: "info"(default)|"success"|"warning"|"danger"; 3rd arg: duration ms (default 3500, 0 = sticky) OR {duration, actionText, onAction} for an action button ("Undo")
skOpenModal(id) / skCloseModal(id) — also open/close drawers and command palettes
skToggleTheme() — flips dark family ↔ light family; persisted in localStorage
skSetTheme(name) — switches to "dark"|"midnight"|"forest"|"dusk"|"contrast"|"light"|"paper"|"sky"|"rose"|"auto" (or a custom theme); persisted
skConfirm(message, opts?) → Promise — builds a confirm modal; opts: {title, okText, cancelText, danger}
skPrompt(message, opts?) → Promise — input dialog (null on cancel/Esc); opts: {title, okText, cancelText, placeholder, value}
skTour() — starts an on-page tour of elements marked data-sk-tour (spotlight + explainer card, Back/Next, Esc ends)
skTypewriter(el, text, msPerChar?) → Promise — types text into el (instant under reduced motion)
skSelectedRows(tableOrId) → array of selected
elements of a data-sk-select table
## Data attributes (wire up behavior, no JS)
data-sk-open="id" — button opens that modal, drawer, OR command palette
data-sk-close — element inside a modal/drawer closes it (backdrop click + Esc also close)
data-sk-popover — trigger button inside .sk-popover toggles its .sk-popover-panel (outside click + Esc close)
data-sk-carousel-prev / data-sk-carousel-next — buttons inside .sk-carousel scroll the track one view
data-sk-tabs — on tab container; data-sk-tab="panel-id" — on each tab button (panel = element with that id)
data-sk-dropdown — on trigger button inside .sk-dropdown
data-sk-sidebar — button toggles .sk-sidebar on mobile
data-sk-burger — button toggles navbar links on mobile
data-sk-toast="Msg" + optional data-sk-toast-type="success|warning|danger" — button shows toast
data-sk-theme-toggle — button flips dark ↔ light theme family (persisted across page loads)
data-sk-theme="name" — button switches to that theme: dark|midnight|forest|dusk|contrast|light|paper|sky|rose|auto (persisted)
data-sk-validate — on a