Velvet Studio 2.0
Components Playground Design System Patterns Rust Docs
AREA 02 · COMPONENT CATALOG

Living UI Component Library

Every reusable component rendered directly in pure Rust. Each specimen follows the unified Storybook-grade specification template.

ACTIONS

Group 01: Buttons & Links

Direct action triggers with pure CSS states and sub-microsecond event dispatch

ButtonImplementedComponents / Actions / Button
Primary interaction trigger. Pure CSS states, zero VDOM diffing, sub-microsecond event dispatch.

Live Preview

Active specimen rendered via velvet_html::view
Outline ActionGhost Action
Property Specifications:
variantDefault: Solid · Allowed: Solid, Soft, Outline, Ghost, Danger
sizeDefault: Md · Allowed: Sm, Md, Lg
toneDefault: Accent · Allowed: Accent, Ok, Warn, Danger, Muted
disabledDefault: false · Allowed: true, false

Idiomatic Rust API

Copyable snippet for application views
rust
btn_kv("save", "Save Changes", BtnKind::Primary, &[("draft", "val")])
    .variant(Variant::Solid)
    .tone(Intent::Accent)
    .size(Size::Md)
A11y & Constraints: Keyboard activation via Enter/Space; automatic aria-disabled; focus-visible ring.
LinkImplementedComponents / Actions / Link
Semantic SPA navigation anchor. Direct route resolution with speculative prerender.

Live Preview

Active specimen rendered via velvet_html::view
Property Specifications:
hrefDefault: "#" · Allowed: Relative or internal route path
variantDefault: Ghost · Allowed: Solid, Outline, Ghost

Idiomatic Rust API

Copyable snippet for application views
rust
link("/performance", "Open Performance")
    .variant(Variant::Solid)
A11y & Constraints: Standard <a> element semantics; underline indication on hover; readable link texts.
INPUTS

Group 02: Form Inputs & Controls

High-performance form controls bound to HTML5 native validation and AppError envelopes

Text InputImplementedComponents / Inputs / Text Input
Single-line alphanumeric text control with HTML5 validation and AppError error binding.

Live Preview

Active specimen rendered via velvet_html::view
Account Identifier
Developer Email
Property Specifications:
labelDefault: Required · Allowed: Readable form label
nameDefault: Ident · Allowed: Form post key
placeholderDefault: Optional · Allowed: Hint string

Idiomatic Rust API

Copyable snippet for application views
rust
field("Account Identifier", "account_id", value, "Enter ID...")
A11y & Constraints: Linked <label for=id>; aria-invalid set on constraint failure; screen reader announced.
SwitchImplementedComponents / Inputs / Switch Toggle
Binary toggle switch using CSS pseudo-elements and native checkbox state under the hood.

Live Preview

Active specimen rendered via velvet_html::view
Property Specifications:
actDefault: Required · Allowed: Act name triggered on toggle
checkedDefault: false · Allowed: Boolean toggle state

Idiomatic Rust API

Copyable snippet for application views
rust
switch("toggle_telemetry", "telemetry", "Enable telemetry", true)
A11y & Constraints: Role='switch'; aria-checked='true'|'false'; Space key toggles state cleanly.
FORMS

Group 03: FormBuilder & Validation

Declarative form compositors bound to closed acts with zero client-side JavaScript

FormBuilderImplementedComponents / Forms / FormBuilder
Type-safe declarative form compositor bound to closed acts with native submit handling.

Live Preview

Active specimen rendered via velvet_html::view
Deployment Region
Deployment Tier
Property Specifications:
actDefault: HomeAct · Allowed: Closed enum act contract
validationDefault: v_note · Allowed: HTML5 Constraint and AppError validator

Idiomatic Rust API

Copyable snippet for application views
rust
FormBuilder::new(HomeAct::Ping.as_str())
    .required_text("draft", "Note")
    .placeholder("Enter text...")
    .submit("Send Act")
    .build(fields)
A11y & Constraints: Automatic form group association, focus jump to first invalid field on error.
TYPOGRAPHY

Group 04: Headings, Prose & Badges

Semantic typographic system featuring proportional scale, optical line-heights, and tone intent

Text & ProseImplementedComponents / Typography / Text Scale
Semantic typographic system featuring proportional scale, optical line-heights, and tone intent.

Live Preview

Active specimen rendered via velvet_html::view
Display Heading (2.25rem · Bold)Section Heading (1.5rem · SemiBold)Body Prose Text with standard 1.5 line height for high legibility.Muted explanatory subtitle prose.
Property Specifications:
toneDefault: Default · Allowed: Accent, Ok, Warn, Danger, Muted
proseDefault: Normal · Allowed: Body, Lead, Muted, Code

Idiomatic Rust API

Copyable snippet for application views
rust
text("High performance engine").tone(Intent::Accent)
A11y & Constraints: Semantic p, span, h1-h6 tags; WCAG AAA 7:1 contrast on all primary surfaces.
BadgeImplementedComponents / Typography / Badges & Pills
Compact semantic pill for statuses, versions, tags, and categorical indicators.

Live Preview

Active specimen rendered via velvet_html::view
Solid AccentSoft SuccessOutline WarnDanger AlertMuted Tag
Property Specifications:
variantDefault: Soft · Allowed: Solid, Soft, Outline
toneDefault: Accent · Allowed: Accent, Ok, Warn, Danger, Muted

Idiomatic Rust API

Copyable snippet for application views
rust
badge("Implemented").tone(Intent::Ok).variant(Variant::Soft)
A11y & Constraints: Distinct background and border tones; readable text without relying on color alone.
LAYOUT

Group 05: Containers, Stacks & Bento

Zero-JS layout primitives: flex stacks, clusters, and responsive bento grids

Bento GridImplementedComponents / Layout / Bento Grid
Asymmetric 2026 bento grid engine supporting custom column spans and responsive collapse.

Live Preview

Active specimen rendered via velvet_html::view

Span 2 Tile

Takes 2 grid columns
Spanning layout content.

Span 1 Tile

Takes 1 grid column
Compact box.

Span 1 Tile

Takes 1 grid column
Compact box.
Property Specifications:
spanDefault: 1 · Allowed: 1, 2, 3, 4 columns
gapDefault: Md · Allowed: Tight, Sm, Md, Lg

Idiomatic Rust API

Copyable snippet for application views
rust
bento([
    panel_icon("layers", "Title", "Sub", body).span(2),
    panel_icon("cpu", "Title", "Sub", body).span(1),
])
A11y & Constraints: Grid semantics; responsive collapse to single column below 768px.
SURFACES

Group 06: Cards & Surfaces

Structured containers with elevation tokens, borders, and depth shadows

CardImplementedComponents / Surfaces / Card
Primary elevated surface container with border tokens, rounded corners, and depth shadow.

Live Preview

Active specimen rendered via velvet_html::view
Surface: FlatSurface: ElevatedSurface: GlassSurface: Sunken
Property Specifications:
surfaceDefault: Flat · Allowed: Flat, Elevated, Glass, Sunken

Idiomatic Rust API

Copyable snippet for application views
rust
surface(body).with_surface(Surface::Elevated)
A11y & Constraints: Clear visual boundary; contrast verified across Dark, Light, and Midnight themes.
Panel IconImplementedComponents / Surfaces / Panel Icon
Feature container uniting icon glyph, title, subtitle kicker, and arbitrary View payload.

Live Preview

Active specimen rendered via velvet_html::view

Kernel Cell

Sub-microsecond dispatch
Encapsulated panel with glyph.
Property Specifications:
iconDefault: "cpu" · Allowed: Registry icon identifier
toneDefault: Accent · Allowed: Accent, Ok, Warn, Danger, Purple

Idiomatic Rust API

Copyable snippet for application views
rust
panel_icon("cpu", "Title", "Sub", body).tone(Intent::Accent)
A11y & Constraints: Structured headings h3 with aria-hidden decorative icon.
NAVIGATION

Group 07: Tabs & Navigation Rails

Segmented navigation and routing controls with active state indicators

TabsImplementedComponents / Navigation / Segmented Tabs
Segmented navigation switch with active indicator and instant island view swapping.

Live Preview

Active specimen rendered via velvet_html::view
Property Specifications:
itemsDefault: Slice · Allowed: Label and active state boolean

Idiomatic Rust API

Copyable snippet for application views
rust
tabs(&[("Overview", true), ("Components", false), ("Playground", false)])
A11y & Constraints: Role='tablist', role='tab', aria-selected='true', roving tabindex navigation.
OVERLAYS

Group 08: Popovers & Dialogs

Native CSS Anchor Positioning and HTML5 dialogs with zero client JavaScript

CSS Anchor PopoverImplementedComponents / Overlays / CSS Anchor Popover
Ultra-modern popover positioning using native CSS Anchor Positioning and @starting-style.

Live Preview

Active specimen rendered via velvet_html::view
Property Specifications:
popoverDefault: auto · Allowed: Native HTML5 popover attribute with light dismiss

Idiomatic Rust API

Copyable snippet for application views
rust
btn_kv("open_popover", "Settings", BtnKind::Ghost, &[("target", "settings-id")])
A11y & Constraints: Popover='auto' handles light dismiss and Esc key natively with 0 kB JavaScript.
FEEDBACK

Group 09: Notices & Toasts

Semantic inline alerts, banners, and auto-dismissing toast notifications

Notice BarImplementedComponents / Feedback / Notice Bar
Inline contextual alert message with tone intent styling and icon integration.

Live Preview

Active specimen rendered via velvet_html::view
Info: Kernel synchronization verified across all islands.
Success: All 27 integration tests passing in hermetic CI.
Warning: Rate limit threshold reaching 85% capacity.
Danger: Unauthorized mutation act rejected (code 403).
Property Specifications:
toneDefault: Info · Allowed: Info, Ok, Warn, Danger

Idiomatic Rust API

Copyable snippet for application views
rust
notice_bar(text("Operation completed successfully")).tone(Intent::Ok)
A11y & Constraints: Role='status' or role='alert' depending on severity; distinct icon cues.
ButtonImplementedComponents / Feedback / Toast Lab (Tones)
Primary interaction trigger. Pure CSS states, zero VDOM diffing, sub-microsecond event dispatch.

Live Preview

Active specimen rendered via velvet_html::view
Each tone fires instantly through the WASM motor — no server round-trip, no JavaScript. The tray stacks (2.8 s life) at bottom-center.
Property Specifications:
toneDefault: cue_* · Allowed: success / warn / error — instant, no server

Idiomatic Rust API

Copyable snippet for application views
rust
btn_kv("cue_success", "Save", BtnKind::Primary, &[])
A11y & Constraints: Keyboard activation via Enter/Space; automatic aria-disabled; focus-visible ring.
Toast NotificationsImplementedComponents / Feedback / Notification Toasts
Transient floating notifications in top/bottom tray with auto-dismiss and zero layout shift.

Live Preview

Active specimen rendered via velvet_html::view
Property Specifications:
durationDefault: 5s · Allowed: Auto-dismiss timer in tray

Idiomatic Rust API

Copyable snippet for application views
rust
toast_act("File saved successfully", "undo", "Undo");
A11y & Constraints: Aria-live='polite'; non-disruptive announcements; accessible close button.
DATA DISPLAY

Group 10: Tables & Metric KPIs

High-density data tables and telemetry counters with zero hydration delay

Metric KPIImplementedComponents / Data / Metric KPI
High-impact visual telemetry counter featuring large numeric glyph and explanatory label.

Live Preview

Active specimen rendered via velvet_html::view
0.75 µsParser Latency
99.99%Uptime SLA
0 kBClient JS Download
12 800Melem/s Event Rate
Property Specifications:
toneDefault: Accent · Allowed: Accent, Ok, Warn, Danger, Purple

Idiomatic Rust API

Copyable snippet for application views
rust
metric("0.75 µs", "Parser Latency").tone(Intent::Accent)
A11y & Constraints: Screen reader friendly numeric layout; unit announced intelligibly.
Table & QueryGridImplementedComponents / Data / Dense Table
High-density data table supporting sticky column headers, sorting, and pagination without JS.

Live Preview

Active specimen rendered via velvet_html::view
Verified tabular records without virtual DOM cost:
Ada LovelaceAdminada@lovelace.dev
Alan TuringEngineeralan@turing.dev
Property Specifications:
columnsDefault: Slice · Allowed: Header labels

Idiomatic Rust API

Copyable snippet for application views
rust
table(&["Name", "Role", "Email"], rows)
A11y & Constraints: Th tags with scope='col'; caption element; aria-sort on active columns.
MEDIA & CHARTS

Group 11: Pure Rust SVG Charts

Server-rendered SVG sparklines and telemetry bars with zero external dependencies

SVG Bars ChartImplementedComponents / Media / Telemetry Bars
Pure Rust SVG telemetry bar graph rendered in under 15 microseconds without external JS.

Live Preview

Active specimen rendered via velvet_html::view
Property Specifications:
itemsDefault: Slice · Allowed: Label and numeric percentage (0.0 - 100.0)

Idiomatic Rust API

Copyable snippet for application views
rust
bars(&[("CPU Load", 18.5), ("WASM Mem", 42.0), ("Bus Sync", 94.0)])
A11y & Constraints: Embedded <title> and <desc> SVG elements; accessible data table fallback.
SVG SparklineImplementedComponents / Media / SVG Sparkline
Micro-chart area sparkline showing trends and telemetry curves directly in table rows.

Live Preview

Active specimen rendered via velvet_html::view
7-day telemetry activity:
Trend: +24.8%12.8 k Req/s
Property Specifications:
valuesDefault: Slice · Allowed: f64 time-series points

Idiomatic Rust API

Copyable snippet for application views
rust
spark_area(&[12.0, 18.0, 14.0, 22.0, 35.0, 28.0, 42.0])
A11y & Constraints: Role='img' with aria-label describing trend direction.
ADVANCED

Group 12: Closed Acts & MCP AI Server

Single-reducer state machines, View memoization, and Model Context Protocol endpoints

Closed Acts SystemImplementedComponents / Advanced / Closed Acts System
Single reducer, wire-safe typed enum acts shared across SSR, WASM, and MCP AI agents.

Live Preview

Active specimen rendered via velvet_html::view
rust
velvet_html::closed_act! {
    pub enum HomeAct {
        Ping => "saas_showcase_ping" {
            islands = &["count"],
            form = NoteForm
        },
    }
}
One reducer drives both SSR and WASM island morphing with zero drift.
Property Specifications:
actDefault: Enum · Allowed: Declared via closed_act! macro

Idiomatic Rust API

Copyable snippet for application views
rust
HomeAct::Ping => { ... state.count += 1; }
A11y & Constraints: Deterministic state transitions; zero client-side mutation race conditions.
MCP AI ServerImplementedComponents / Advanced / Autonomous MCP AI Server
Autonomous Model Context Protocol endpoint exposing typed application acts to LLMs over JSON-RPC 2.0.

Live Preview

Active specimen rendered via velvet_html::view
Exposes typed application acts to LLMs over JSON-RPC 2.0.
JSON-RPC 2.0OpenAPI 3.1/__mcp
Property Specifications:
protocolDefault: MCP · Allowed: Model Context Protocol compliant endpoint

Idiomatic Rust API

Copyable snippet for application views
rust
velvet_serve::ServeOpts::from_env().with_kernel(&KERNEL).with_openapi()
A11y & Constraints: Standard JSON-RPC 2.0 wire format compliant with Anthropic MCP specifications.

Command Palette

PREVIEW VELVET 2.0

Select an item

Select or hover an item to inspect live route details, contracts, and schema bindings.

Route: /components
Latency: < 0.9 ms (SSR)
Contract: Pure Rust
↵ Open Esc Close

Keyboard Shortcuts

Command Palette / Search⌘K / Ctrl+K
Time-Travel Undo (Rollback)Ctrl+Z
Toggle Light / Dark ThemeMod+Shift+L
Cycle Layout ShellMod+Shift+F
Cycle Density ScaleMod+Shift+D
DevTools Drawer⌘I / Mod+I
High Contrast (WCAG AAA)Mod+Shift+C
Reduced MotionMod+Shift+M

Velvet DevTools

WASM Active
Schema, Acts & Autonomous MCP
POST /__act POST /__mcp GET /act.schema.json GET /openapi.json
HomeAct::Ping → island: count
AuthAct::SignIn → island: session-hint
Proc::UserRows → island: user-rows (q: text)
MCP Tools/List → endpoint: /__mcp (JSON-RPC 2.0)
Engine Telemetry & Allocations
0 Heap Allocs / span 0.1 ms Paint 12 800 M/s
Live Session Tape (Flight Recorder)
[0.00s] boot_catalog 12 pages, 16 routes verified
[0.02s] session_init WASM active, 0 heap allocs
Interactive Act Dispatcher
View Schema Ready
Active Island Inspector (DOM Morph Target)
No active islands on current page
Browser Self-Check (what YOUR browser runs)
waiting…
Autonomous MCP Tool Console
View Act Schema
Ready
Color Contrast & Accessibility
Text to Background 14.8:1 (AAA Pass ✓)

Settings

Språk / Language
Theme Mode
Design Style
Color Palette
Layout Shell
Density
Accessibility (WCAG AAA)