Design System Playground
Every @stnd/ui component and design token in one place. A living quality check — flip themes in the Lab and watch everything update.
Accordion
Is it accessible?
Yes. It adheres to the WAI-ARIA design pattern.
Is it styled?
Yes. It comes with default styles that matches the other components' aesthetic.
Is it animated?
Yes. It's animated by default, but you can disable it if you prefer.
Avatar
Badge
Card
Login to your account
Enter your details below to login to your account
Meeting Notes
Transcript from the meeting with the client.
Client requested dashboard redesign with focus on mobile responsiveness.
- New analytics widgets for daily/weekly metrics
- Simplified navigation menu
- Dark mode support
- Timeline: 6 weeks
- Follow-up meeting scheduled for next Tuesday
Is this an image?
This is a card with an image.
Header and Content
This is a card with a header and a content.
Header + Content + Footer
This is a card with a header, content and footer.
Skeleton
Table
| Invoice | Status | Method | Amount |
|---|---|---|---|
| INV001 | Paid | Credit Card | $250.00 |
| INV002 | Pending | PayPal | $150.00 |
| INV003 | Unpaid | Bank Transfer | $350.00 |
| INV004 | Paid | Paypal | $450.00 |
| INV005 | Paid | Credit Card | $550.00 |
| INV006 | Pending | Bank Transfer | $200.00 |
| INV007 | Unpaid | Credit Card | $300.00 |
| Total | $2,500.00 | ||
Tooltip
Toast
Lightweight notification system. Dispatches a custom toast event — no framework needed. The Toast component listens globally and renders items in a fixed container at the top of the viewport.
Scroller
A fixed scroll-progress bar at the very top of the page. It's already active on this page — scroll down and watch the thin line fill. No configuration needed; it's mounted automatically by the Base layout.
The bar at the top of this page is the Scroller. It uses window.scrollY and the document height to compute a 0–100% fill width, rendered as a glassmorphic strip with a glow shadow.
Example: 60% through page
Button
Checkbox
By clicking this checkbox, you agree to the terms and conditions.
Form
Input
Label
Radio Group
Slider
Switch
Textarea
Type your message and press enter to send.
Dialog
Dialog Manager
Programmatic confirmation dialogs via a Svelte store. Call confirm({ title, description }) from any script — it returns a Promise<boolean>. Mount DialogManager once in the layout; it handles rendering.
Popover
Dimensions
Set the dimensions for the layer.
Select
Combobox
Context Menu
Right-click (or long-press) the cards below. The menu is viewport-aware — try near screen edges.
Hue Palette
Every hue derived from the foreground seed via OKLCH offsets.
redorangeyellowgreencyanbluemagentaSemantic Colors
Status, feedback, and UI signal colors.
successwarningerrorinfoaccentlinkForeground Tones
--color-foreground--color-muted--color-subtle--color-border--color-backgroundSurface Elevations
--color-surface-lower--color-surface-lowest--color-surface-low--color-surface--color-surface-high--color-surface-highest--color-surface-higherColored Text
Each hue as body text on the page background. Verify every color remains legible at reading size.
The quick red fox. 0123456789
The quick orange fox. 0123456789
The quick yellow fox. 0123456789
The quick green fox. 0123456789
The quick cyan fox. 0123456789
The quick blue fox. 0123456789
The quick magenta fox. 0123456789
The quick success fox. 0123456789
The quick warning fox. 0123456789
The quick error fox. 0123456789
The quick info fox. 0123456789
The quick accent fox. 0123456789
The quick link fox. 0123456789
Button Palette
All variants and every palette hue. Flip themes in the Lab to verify contrast.
Badge Palette
Filled, secondary, and outline variants across all hues.
Alert Palette
Semantic alert banners. Border, background tint, and text must all remain readable.
Real-World Patterns
Typical UI patterns combining color with text and backgrounds.
Type Scale
6xlAg5xlAg4xlAg3xlAg2xlAgxlAglgAgbaseAgsmAgxsAg2xsAg3xsAgSans
Inter — rmts
Everyone has the right to freedom of thought, conscience and religion; this right includes freedom to change his religion or belief.
Serif
Source Serif 4
No one shall be subjected to arbitrary arrest, detention or exile. Everyone is entitled in full equality to a fair and public hearing.
Monospace
IBM Plex Mono
No one shall be held in slavery or servitude; slavery and the slave trade shall be prohibited in all their forms.
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Spacing Tokens
All spacing is based on --baseline (1rlh).
--space-d8--space-d6--trim--space-d4--leading--space-d3--space-d2--space-half--space--space-2--space-3--space-4--space-6--space-8--space-12Content Measure
Max content widths for readability.
--line-width-xs--line-width-sm--line-width-md--line-width-lg--line-width-xlShadows
Raised
--shadow-raisedDefault surfaceAmbient
--shadowSubtle drop shadowLarge
--shadow-lgAmbient + liftExtra Large
--shadow-xlAmbient + lift + glowGlow
--shadow-glowAccent-colored glowInset
--shadow-insetPressed stateRing
--shadow-ring1px inset borderEasing & Speed Lab
Visualize and compare the transition timing functions and durations available in the framework. Pick a preset or define a customcubic-bezier, adjust the duration, then hit Play.
transition: all 0.5s ease;Compare two easings side-by-side
@stnd/ui
Shared UI components for the Standard Ecosystem.
Most buttons/badges/cards should just be a CSS class on plain HTML (see @stnd/styles) — no JS, no import. This package is only for the handful of things that genuinely need interactivity: a dropdown that manages keyboard navigation, a confirm dialog you can await, a right-click menu. If you’re reaching for a component here and it’s not doing something stateful or ARIA-heavy, check whether a CSS class already does the job.
Use it (the confirm dialog, the most common one):
import { confirm } from "@stnd/ui/dialog.js";
const ok = await confirm({ title: "Delete this?", intent: "danger" });
Overview
@stnd/ui provides a collection of reusable, accessible, and high-quality UI components built for Astro and Svelte 5. These components are designed to work seamlessly with @stnd/styles and follow the Standard design principles.
🏛 The Philosophy: CSS First, Components Second
Standard is built on the philosophy of keeping the codebase as clean, fast, and static as possible. Before importing a component from @stnd/ui, ask yourself: Can this be done with just HTML and @stnd/styles?
Many UI elements you see in the Playground (like Buttons, Badges, Cards, and Inputs) are not components. They are simple CSS classes applied to standard HTML elements.
Why?
- Zero JavaScript overhead.
- Perfect semantic HTML.
- Maximum flexibility without passing dozens of props.
Example: Buttons & Badges (CSS Only)
You do not need a <Button> or <Badge> component. Just use the global classes provided by @stnd/styles:
<!-- Primary Button -->
<button class="btn">Save Changes</button>
<!-- Ghost Button -->
<button class="btn ghost">Cancel</button>
<!-- Success Badge -->
<span class="badge success">Active</span>
When to use @stnd/ui Components?
You should only import components from this package when you need:
- Complex interactivity (e.g.,
Dropdown,ContextMenu). - State management (e.g.,
DialogManager,ComboBox). - Advanced Accessibility / ARIA management (e.g.,
Accordion). - Complex composition (e.g.,
Accordion,Scroller,TableOfContents).
Icons and Lottie animations are not in this package — they live in
@stnd/icon(import Icon from "@stnd/icon/Icon.astro"). See its README.
🧩 Component API Reference
Astro Components (Zero JS)
<Accordion />
Accessible, collapsible content sections.
open(boolean): Sets the initial open state.
Svelte 5 Components (Hydrated)
<Alert />
Semantic feedback banners.
class(string): The semantic intent:success,warning,error,info. (Defaults to accent color).title(string): Optional bold title.icon(string): Optional string icon (e.g.,✓,⚠).
<Alert class="warning" title="Watch out!" icon="⚠">
This action cannot be undone.
</Alert>
<Dropdown />
Accessible, keyboard-navigable dropdown menus.
align(string): Alignment of the menu (start,center,end). Defaults tostart.- Slots:
trigger(the button that opens the menu),default(the menu items).
Related Sub-components:
<DropdownItem icon="ph:user" shortcut="⌘P">Profile</DropdownItem><DropdownLabel label="My Account" /><DropdownSeparator />
<ContextMenu />
Viewport-aware right-click menus.
- Slots:
default(the area that triggers the menu on right-click),content(the menu items).
🚨 Dialog Manager
The DialogManager allows you to trigger accessible confirmation dialogs programmatically from any script using a simple Promise-based API. This prevents littering your DOM with hidden modal HTML.
1. Mount the Manager
Ensure <DialogManagerComponent client:load /> is mounted once in your root layout (Standard does this by default).
2. Call the API
import { confirm } from "@stnd/ui/dialog.js";
const isConfirmed = await confirm({
title: "Delete this item?",
description: "This action cannot be undone. Are you sure?",
confirmLabel: "Yes, Delete",
cancelLabel: "Cancel",
intent: "danger" // "neutral" | "danger"
});
if (isConfirmed) {
// Proceed with deletion
}
Notes / Observations
(jot down anything noticed here — quirks, gotchas, ideas)
Todo
- [ ] README is thin relative to the component count —
Combobox,
Panel,Pagination,Scroller,TableOfContents,Toast,CfImage,LauncherHintexist on disk but aren’t documented above. Worth a pass once this package settles.
