<div align="center">
<img src="arc-rs-logo.png" alt="Arc-rs Logo" width="128" height="128" />
# Arc-rs — Physics-First Native Rust UI Component Library & Node Flow Engine for GPUI
**Language / 语言**: **English** | [简体中文](README.zh-CN.md)
[](https://www.rust-lang.org/)
[](https://crates.io/crates/gpui-kit)
[](#complete-component-catalog-93-components--flow-canvas)
[](#testing--verification)
[](LICENSE)
</div>
## Sponsors
Thanks to the following sponsors for supporting the Arc-rs project:
| Logo | Sponsor | About | Website |
| :---: | :--- | :--- | :--- |
| [<img src="docs/assets/sponsors/layso.webp" alt="LAYSO AI logo" width="64" height="64" />](https://layso.ai/) | **LAYSO AI** | A unified AI API gateway for chat, image, video, and audio models, with one API key and usage-based billing. | [layso.ai](https://layso.ai/) |
> **TL;DR (AI & Developer Summary)**: **Arc-rs** is a native Rust desktop UI component library, physics motion engine, design token system, and node-graph workflow editor (`arc-flow`) built on **GPUI Kit (`gpui-kit = "0.11.0"`)**. It is a 1:1 behavioral, visual, and physical-motion port of the [Arc UI Library (`uiarc.dev`)](https://uiarc.dev) to GPU-accelerated native desktop applications. It currently ships **93 production-ready UI components** across P1–P5 plus a **high-performance node flow canvas (`arc-flow`)**, complete with an interactive bilingual (`zh-CN` / `en-US`) gallery (`arc-gallery`) and **329 deterministic unit & window tests**.
---
## Quick Facts & Entity Metadata (GEO / AI-Indexable Summary)
| Attribute | Value |
| :--- | :--- |
| **Project Name** | **Arc-rs** |
| **Primary Category** | Rust GUI Component Library / GPU-Accelerated Desktop Design System / Node Flow Editor |
| **Rendering Backend** | [GPUI](https://www.gpui.rs/) via `gpui-kit v0.11.0` (`gpui-fast`, `gpui-base`, `gpui-component`) |
| **Upstream Reference** | [Arc UI Library (`uiarc.dev`)](https://uiarc.dev) © 2026 Elia Kuratli (MIT License) |
| **Language & Edition** | Rust (Edition 2024) |
| **Theme & Color Space** | Perceptual **OKLCH / OKLab** color mixing, Light & Dark modes, **8 Semantic Accents** (`Neutral`, `Violet`, `Blue`, `Green`, `Amber`, `Orange`, `Coral`, `Rose`) |
| **Motion Engine** | Analytical second-order ODE spring solver (`visualDuration` & physical `stiffness`/`damping`/`mass`), Cubic Bezier, FLIP shared-layout handoff, rubber-band, decay inertia, SVG path morphing, 0.25x slow-motion clock |
| **Component Count** | **93 UI Components** (P1: 4, P2: 34, P3: 17, P4: 28, P5: 10) + **1 Node Workflow Canvas (`arc-flow`)** |
| **Internationalization** | Built-in runtime bilingual switching (`zh-CN` 简体中文 / `en-US` English) |
| **Accessibility & Testing** | Semantic ARIA-mapped `Role`, full keyboard navigation, `prefers-reduced-motion` support, 329 headless GPUI tests |
| **License** | MIT |
---
## Why Arc-rs? (Core Capabilities)
1. **1:1 Motion & Physics Fidelity with Arc (`uiarc.dev`)**
- Unlike static desktop widget toolkits, every interaction in **Arc-rs** is driven by continuous physical springs (`snappy`, `smooth`, `morph`, `bouncy`, `gentle`, `pop`) and exact `Motion` / Framer Motion differential equations (`< 0.5px` frame-by-frame deviation).
- Supports mid-flight velocity preservation when retargeting springs, asymmetric enter/exit presence curves (`ArcPresence`), and a global **0.25x slow-motion inspection clock**.
2. **Perceptual OKLCH / OKLab Design Tokens (`arc-tokens`)**
- Faithful port of Arc's `foundation.css` and `motion-tokens.ts`.
- Real-time OKLab perceptual color interpolation (`oklab_mix`) prevents muddy mid-tones during hover, press, and theme transitions.
- Instant runtime switching between **Light / Dark** themes and **8 accent palettes**.
3. **93 Rich Interactive Desktop Components (`arc-ui`)**
- Covers everything from micro-animated buttons, morphing icons, odometer counters, and slot-machine text to complex inputs & gesture feedback like **Ruler Slider**, **Date Range Picker**, **Money Input**, **Scrub Input**, **Signature Pad**, **File Dropzone**, **Rich Text Editor**, **Hold to Confirm**, **Swipe Actions**, **Confirm Morph**, **Usage Meter**, **Onboarding Checklist**, **Announcement Bar**, and **Cookie Consent**.
4. **GPU-Accelerated Node & Workflow Editor (`arc-flow` & `arc-flow-core`)**
- Built-in React Flow / xyflow-inspired node graph engine for AI pipelines, shader graphs, and automation workflows.
- Features spatial grid culling (`1,000+` nodes), typed port validation, magnetic `28px` port snapping, Bezier / orthogonal step edges, marquee multi-selection, undo/redo history with nudge coalescing, and embedded interactive GPUI controls inside nodes.
5. **Interactive 15-Section Bilingual Documentation Gallery (`arc-gallery`)**
- Every single component includes a live interactive preview, copyable Rust/GPUI code, and a complete 15-section `uiarc.dev`-style documentation page (Overview, Preview/Code, When to use, When not to use, Usage, API Reference, Keyboard Interaction, Accessibility, Motion, Responsive Behavior, Performance, and AI Notes) in both **Chinese (`zh-CN`)** and **English (`en-US`)**.
---
## Workspace Architecture
```text
Arc-rs/
├── crates/
│ ├── arc-tokens/ # Design tokens: OKLCH/OKLab palettes, 8 accents, typography, radii, shadows, spring specs, i18n
│ ├── arc-motion/ # Physics & animation engine: ODE spring solver, CubicBezier, ArcPresence, FLIP layout, DragTracker, InertiaSolver
│ ├── arc-ui/ # 93 GPUI components across actions/, inputs/, disclosure/, overlay/, feedback/, data/, text/
│ ├── arc-flow-core/ # Pure data/math graph engine: Graph, Node, Edge, typed Ports, reversible Ops, History, SpatialGrid
│ └── arc-flow/ # Interactive GPUI workflow canvas: pan/zoom viewport, 4-layer renderer, port wiring, marquee selection
├── apps/
│ └── arc-gallery/ # Interactive desktop showcase & 15-section bilingual documentation browser (92 stories)
├── tools/
│ └── arc-ref/ # Playwright curve extractor & pixel/motion parity verification suite against upstream Web Arc
└── docs/
├── porting/ # Architectural decisions (P0-DECISIONS.md), component template, and porting progress (PROGRESS.md)
└── flow/ # Node workflow engine specification (arc-flow-plan.md) & F0 API verification
```
### Crate Responsibilities
| Crate | Path | Description |
| :--- | :--- | :--- |
| **`arc-gpui`** | `crates/arc-gpui` | **Recommended all-in-one facade crate**: single-line install re-exporting `tokens`, `motion`, `ui` (120+ components & charts at crate root), `flow` / `flow_core` (default feature), `gpui_kit`, `prelude`, and `init_arc(...)`. |
| **`arc-tokens`** | `crates/arc-tokens` | Zero-allocation token definitions: `ArcColors`, `ThemeMode` (`Light`/`Dark`), `Accent` (8 presets), `SpringSpec`, `CubicBezierSpec`, `Spacing`, `Radii`, `Shadows`, `Typography`, `Locale` (`ZhCn`/`EnUs`), and `install_arc_theme`. |
| **`arc-motion`** | `crates/arc-motion` | Frame-accurate motion primitives: `arc_spring`, `arc_spring_with_options`, `arc_transition`, `ArcPresence`, `SharedLayoutRegistry` (FLIP), `DragTracker`, `InertiaSolver`, `rubber_band_signed`, `morph_svg_paths`, `BlurFallback`, and `MotionClock`. |
| **`arc-ui`** | `crates/arc-ui` | Complete UI component library organized into 8 domain modules (`actions`, `inputs`, `disclosure`, `overlay`, `feedback`, `data`, `text`, `chart`), also re-exporting `tokens` and `motion`, plus a window-level `ArcOverlay` portal layer. |
| **`arc-flow-core`** | `crates/arc-flow-core` | UI-agnostic directed graph kernel: `Graph`, `GraphOp` atomic transactions, undo/redo `History`, xyflow-compatible Bezier/SmoothStep edge paths, 2D `SpatialGrid` culling, and JSON serialization. |
| **`arc-flow`** | `crates/arc-flow` | GPUI `FlowCanvas` entity supporting pan/zoom about cursor, port-to-port connection dragging with live validation, multi-node drag with grid snap, clipboard copy/paste, and in-node focusable inputs. |
| **`arc-gallery`** | `apps/arc-gallery` | Native desktop gallery application featuring live FPS telemetry, theme/accent/locale/slow-mo/reduced-motion toggles, global `Shift + Wheel` horizontal scrolling, and interactive documentation stories. |
---
## Getting Started
### v0.4.0 Release and Installation
- [Windows x86_64 installer](https://github.com/eighteendreamer/Arc-rs/releases/download/v0.4.0/arc-gallery-0.4.0-windows-x86_64-setup.exe)
- [Windows x86_64 portable ZIP](https://github.com/eighteendreamer/Arc-rs/releases/download/v0.4.0/arc-gallery-0.4.0-windows-x86_64-portable.zip)
- [SHA-256 checksums](https://github.com/eighteendreamer/Arc-rs/releases/download/v0.4.0/SHA256SUMS.txt)
**Release in progress:** On 2026-12-05, the maintainer confirmed obtaining additional authorization for the React Bits component ports and requested crates.io publication. The authorization terms have not been independently reviewed here; original third-party restrictions remain applicable. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). Until registry verification completes, the commands below are planned 0.4.0 instructions, not confirmation of availability.
The 0.4.0 SDK uses the Arc-maintained `arc-gpui-*` dependency chain (based on GPUI Kit 0.11.0 / GPUI 0.3.14). It requires no local paths or consumer `[patch]`. Use `arc_gpui::gpui_kit`; if a direct Kit dependency is needed, use `gpui-kit = { package = "arc-gpui-kit", version = "=0.4.0" }`. Do not mix upstream `gpui-kit` runtime types with Arc's fork. Original Apache-2.0 licenses and upstream source archive checksums are retained under `vendor/gpui-release/`.
```bash
# Install or upgrade to the version containing the new components
cargo add arc-gpui@0.4.0
# UI only, including the command palette and seven page blocks
cargo add arc-ui@0.4.0
# Optional standalone experimental 3D engine (not included in the facade)
cargo add arc-graphics3d@0.4.0
```
This release includes bilingual sidebar search (Ctrl/Cmd+K), page entrance transitions, the slider track fix, knowledge graphs and the OBJ multi-mesh 3D prototype. The 3D engine uses Lambert shading and GPU readback; PBR, textures, glTF and rigid-body physics are not implemented. Physical 120Hz and cross-platform acceptance are not claimed. Prebuilt binaries currently target Windows x86_64 only; the source retains cross-platform goals.
### AI Component Discovery MCP (Cargo)
- MCP Registry name: `mcp-name: io.github.eighteendreamer/arc-mcp`
`arc-mcp` exposes six offline, read-only capabilities: `get_sdk_overview`, `search_components`, `get_component`, `list_sources`, `get_source`, and `get_setup_guide`. The package embeds a reproducible snapshot of Gallery documentation and SDK source; no checkout, GPU, GPUI runtime, user-file access, shell execution, or external model is needed.
```bash
cargo install arc-mcp --version 0.3.0 --locked
```
The Rust toolchain and a native linker are required. Ensure Cargo's binary directory is on PATH. No Gallery installer or repository clone is needed. Configure the installed binary as a stdio MCP server:
```json
{
"mcpServers": {
"arc-rs": {
"command": "arc-mcp",
"args": []
}
}
}
```
Recommended AI workflow: search by bilingual name/use-case keywords → retrieve API/examples/guidance → verify exact signatures in paginated, line-numbered source → integrate with host state. Search uses deterministic weighted keywords and Chinese bigrams, not vector/semantic inference. The client AI performs code edits; this server only supplies evidence.
The embedded catalog is a **source-tree snapshot**, potentially newer than the published SDK. Match the SDK version and compile-check integrations; examples are render-context snippets, not standalone applications. The installed binary works offline outside the checkout. Maintainers refresh the packaged snapshot with `ARC_MCP_UPDATE_SNAPSHOT=1 cargo build -p arc-mcp` (PowerShell: set `$env:ARC_MCP_UPDATE_SNAPSHOT = "1"` first); normal checkout builds reject stale snapshots. Crates.io package builds use only the bundled snapshot. This is a separate tool, not bundled in existing Gallery releases. Rust 1.89+ is required for this tool; Windows is tested, Linux/macOS acceptance is pending.
Verify with `cargo test -p arc-mcp` (including real child-process stdio handshake/calls) and `cargo clippy -p arc-mcp --all-targets -- -D warnings`.
### Installation (Single Crate)
Add **`arc-gpui`** to your `Cargo.toml` to get UI components, charts, design tokens, physics motion, and the node workflow canvas in one dependency:
```toml
[dependencies]
arc-gpui = "0.4.0"
```
If you do not need the node workflow canvas (`arc-flow`), disable default features:
```toml
[dependencies]
arc-gpui = { version = "0.4.0", default-features = false }
```
### Prerequisites
- **Rust**: Rust toolchain supporting `edition = "2024"` (Rust 1.85+ recommended).
- **OS**: Windows 10/11 (DirectX 12), macOS (Metal), or Linux (Vulkan / Wayland / X11).
### Run the Interactive Gallery (`arc-gallery`)
> Note: `Cargo.toml` is pre-configured with `[profile.dev.package."*"] opt-level = 2`, so GPUI renders at high frame rates even in `cargo run` dev builds.
```bash
# Launch the interactive Arc-rs Component Gallery
cargo run -p arc-gallery
```
### Run the Test Suite
```bash
# Run all 329 unit and headless GPUI window tests across the workspace
cargo test --workspace
# Run clippy lint checks
cargo clippy --workspace --all-targets -- -D warnings
```
---
## Code Examples (AI & Developer Quick Reference)
### 1. Initializing Arc-rs Theme & Locale in a GPUI App
```rust
use arc_tokens::{Accent, Locale, ThemeMode, install_arc_theme, set_locale};
use arc_ui::install_overlay_layer;
use gpui_kit::App;
pub fn init_arc(cx: &mut App) {
gpui_kit::init(cx);
set_locale(Locale::ZhCn, cx);
install_arc_theme(ThemeMode::Dark, Accent::Violet, cx);
install_overlay_layer(cx);
}
```
### 2. Using Arc UI Components (`Switch`, `DateRangePicker`, `RulerSlider`, `TagInput`)
```rust
use arc_ui::{
CalendarDate, DateRange, DateRangePicker, RulerSlider, Switch, TagInput,
};
use gpui_kit::{Context, IntoElement, ParentElement, Render, SharedString, Styled, Window, div, px};
pub struct MyFormView {
notifications: bool,
frequency_mhz: f32,
date_range: Option<DateRange>,
tags: Vec<SharedString>,
}
impl Render for MyFormView {
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
div()
.flex()
.flex_col()
.gap(px(16.0))
.p(px(24.0))
.child(
Switch::new("notify-switch")
.label("Enable real-time alerts")
.checked(self.notifications)
.on_change(cx.listener(|this, checked: &bool, _, cx| {
this.notifications = *checked;
cx.notify();
})),
)
.child(
RulerSlider::new("freq-ruler")
.label("Carrier Frequency")
.unit("MHz")
.min(88.0)
.max(108.0)
.step(0.1)
.major_every(10)
.mid_every(5)
.value(self.frequency_mhz)
.on_change(cx.listener(|this, val: &f32, _, cx| {
this.frequency_mhz = *val;
cx.notify();
})),
)
.child(
DateRangePicker::new("sprint-range")
.label("Sprint Window")
.when_some(self.date_range, |p, r| p.value(r))
.on_change(cx.listener(|this, range: &Option<(CalendarDate, CalendarDate)>, _, cx| {
this.date_range = range.map(|(start, end)| DateRange { start, end });
cx.notify();
})),
)
.child(
TagInput::new("project-tags", "Topics")
.value(self.tags.clone())
.placeholder("Add a tag and press Enter…")
.on_change(cx.listener(|this, next: &[SharedString], _, cx| {
this.tags = next.to_vec();
cx.notify();
})),
)
}
}
```
### 3. Driving Custom Physics Animations with `arc-motion`
```rust
use arc_motion::{ArcPresence, arc_spring};
use arc_tokens::ActiveArcTheme as _;
use gpui_kit::{App, Window};
pub fn sample_card_motion(is_open: bool, window: &mut Window, cx: &mut App) -> (f32, f32) {
let motion = cx.arc_theme().motion;
// 1. Asymmetric enter/exit presence progress (0.0..=1.0)
let presence = ArcPresence::new("card-presence", is_open).sample(window, cx);
// 2. Analytical second-order spring for vertical offset
let offset_y = arc_spring(
"card-offset-y",
if is_open { 0.0 } else { -12.0 },
motion.spring.snappy,
window,
cx,
);
(presence.progress, offset_y)
}
```
---
## Complete Component Catalog (93 Components + Flow Canvas)
All components live in `crates/arc-ui/src/` and are re-exported at the `arc_ui::*` root for ergonomic importing.
### 1. Actions, Gestures & Buttons (`crates/arc-ui/src/actions/`) — 18 Components & Variants
| Registry ID | Rust Struct / API | Source File | Key Capabilities & Physics |
| :--- | :--- | :--- | :--- |
| `button` | `ArcButton`, `ButtonVariant`, `ButtonSize` | `actions/button.rs` | Adaptive width-aware press scale, smooth width morphing (`spring.morph`), loading spinner handoff |
| `action-button` | `ActionButton`, `ActionButtonPhase` | `actions/action_button.rs` | 4-phase state machine (`Idle` → `Pending` → `Success` / `Error`) with `0.24s` critically damped width morph |
| `copy-button` | `CopyButton` | `actions/copy_button.rs` | System clipboard write + check icon swap + `0.22s` pill width spring |
| `split-button` | `SplitButton`, `SplitButtonAction` | `actions/split_button.rs` | Primary action button paired with an attached floating popover action menu |
| `button-group` | `ButtonGroup`, `ButtonGroupItem` | `actions/button_group.rs` | Connected segmented action bar with optional overflow menu trigger |
| `floating-button-group` | `FloatingButtonGroup` | `actions/floating_button_group.rs` | Glassmorphic floating toolbar with sliding highlight pill and reserved label width |
| `expanding-button-group` | `ExpandingButtonGroup` | `actions/expanding_button_group.rs` | Hover/focus expanding action cluster with inline two-step confirmation morph |
| `icon-morph` | `IconMorph`, `IconMorphVariant` | `actions/icon_morph.rs` | 8 vector path morphing icon pairs (`MenuClose`, `PlayPause`, `PlusCheck`, `SunMoon`, etc.) |
| `action-swap` | `ActionSwap`, `ActionSwapItem` | `actions/action_swap.rs` | Directional vertical slot swap between multi-state action labels and icons |
| `theme-switch` | `ThemeSwitch` (`Reveal` / `Eclipse` / `Split` / `Rise`) | `actions/theme_switch.rs` | 4 distinct celestial/geometric theme toggles driving global `ThemeMode` |
| `shortcut-recorder` | `ShortcutRecorder` | `actions/shortcut_recorder.rs` | Live keyboard chord capture, modifier normalization, and reserved-shortcut conflict warning |
| `hold-to-confirm` | `HoldToConfirm` | `actions/hold_to_confirm.rs` | Linear hold-fill progress, `spring.smooth` release rewind, dual-layer clip color flip, and self-drawing checkmark |
| `swipe-actions` | `SwipeActions`, `SwipeAction` | `actions/swipe_actions.rs` | Inbox-style leading/trailing reveal, even multi-action spacing, full-swipe stretch commit, `0.55` rubber-band, and accessible `⋯` menu |
| `reactions` | `Reactions`, `ReactionItem` | `actions/reactions.rs` | Additive icon kick impulse, directional rolling counts, morphing digit width, and floating picker with gliding highlight |
| `confirm-morph` | `ConfirmMorph`, `ConfirmMorphMode` | `actions/confirm_morph.rs` | In-place `Press` / `Hold` / `Countdown` morphing pill with `280ms` arming guard, drawn check, and inline Undo recovery |
### 2. Form & Complex Inputs (`crates/arc-ui/src/inputs/`) — 38 Components
| Registry ID | Rust Struct / API | Source File | Key Capabilities & Physics |
| :--- | :--- | :--- | :--- |
| `switch` | `Switch`, `SwitchSize` | `inputs/switch.rs` | Thumb glide (`spring.snappy`) + squash-and-stretch press deformation |
| `checkbox` | `Checkbox`, `CheckboxState` | `inputs/checkbox.rs` | Checked / Unchecked / Indeterminate states with animated SVG stroke draw |
| `radio-group` | `RadioGroup`, `RadioOption` | `inputs/radio_group.rs` | Keyboard roving focus + spring-loaded inner indicator disc |
| `radio-cards` | `RadioCards`, `RadioCardOption` | `inputs/radio_cards.rs` | Shared-layout selection ring handoff (`0.42s` morph spring) + fast surface tint |
| `input` | `ArcInput` | `inputs/input.rs` | Label, description, validation error roll-in, prefix/suffix slots |
| `textarea` | `ArcTextarea` | `inputs/textarea.rs` | Multi-line text editing with character counter and animated field message |
| `password-field` | `PasswordField` | `inputs/password_field.rs` | Masked input with eye-icon visibility toggle and focus preservation |
| `password-strength` | `PasswordStrength`, `PasswordRule` | `inputs/password_strength.rs` | Entropy estimation meter, 4-segment color bar, and staggered rule checklist |
| `search-field` | `SearchField` | `inputs/search_field.rs` | Magnifier prefix, animated clear button, and Escape-to-clear shortcut |
| `expanding-search` | `ExpandingSearch`, `SearchCandidate` | `inputs/expanding_search.rs` | Compact trigger that expands into a ranked prefix/word/substring command palette |
| `segmented-control` | `SegmentedControl` | `inputs/segmented_control.rs` | Sliding active pill indicator across mutually exclusive segments |
| `toggle-group` | `ToggleGroup`, `ToggleGroupMode` | `inputs/toggle_group.rs` | Single or multi-select toolbar buttons with tactile press scaling |
| `select` | `Select`, `SelectOption` | `inputs/select.rs` | Directional value roll on change + floating popover listbox with 40ms check delay |
| `combobox` | `Combobox`, `ComboboxOption` | `inputs/combobox.rs` | Searchable dropdown filtering labels & keywords with empty-state spring |
| `multi-select` | `MultiSelect`, `MultiSelectOption` | `inputs/multi_select.rs` | Multi-choice picker with rolling badge counter and chip clearing |
| `morph-select` | `MorphSelect`, `MorphSelectGroup` | `inputs/morph_select.rs` | Trigger that physically morphs into an expanded searchable, grouped panel |
| `tag-input` | `TagInput` | `inputs/tag_input.rs` | Pill tag creation, Backspace-to-pop, duplicate pulse (`1.06x` scale), native placeholder alignment |
| `chip-group` | `ChipGroup`, `ChipOption` | `inputs/chip_group.rs` | Staggered reveal (`max_visible`), animated checkmark slot expansion |
| `number-field` | `NumberField` | `inputs/number_field.rs` | Stepper buttons with compounding velocity bump offset and `10px` rubber-band clamping |
| `scrub-input` | `ScrubInput`, `ScrubUnit` | `inputs/scrub_input.rs` | Horizontal drag scrubbing (`12px` rubber-band), angle wrapping, arithmetic expression evaluation (`(12 + 4) * 2px`), and unit switcher |
| `money-input` | `MoneyInput`, `MoneyCurrency` | `inputs/money_input.rs` | Multi-currency selector (`USD`, `EUR`, `GBP`, `JPY`, `CHF`, `CNY`), odometer rolling digits, ghost zero-cents right of caret, paste heuristic parser |
| `phone-input` | `PhoneInput`, `PhoneCountry` | `inputs/phone_input.rs` | Scrollable country dial-code picker, trunk-prefix pattern formatter, E.164 paste auto-detection |
| `slider` | `Slider` | `inputs/slider.rs` | Odometer rolling readout, momentum release carry, and range-gap snapping |
| `elastic-slider` | `ElasticSlider` | `inputs/elastic_slider.rs` | Overshoot rubber-band stretching (`rubber_band_signed`) and vertical track compression |
| `range-histogram-slider` | `RangeHistogramSlider` | `inputs/range_histogram_slider.rs` | Dual-thumb range filter overlaid on a bucketed distribution bar chart |
| `ruler-slider` | `RulerSlider` | `inputs/ruler_slider.rs` | Draggable physical tick tape with momentum coasting (`InertiaSolver`), boundary spring-back, and center hairline |
| `rating` | `Rating` | `inputs/rating.rs` | Half-star precision (`0.5` steps), hover wave cascade, and keyboard digit/arrow controls |
| `calendar` | `Calendar`, `CalendarDate` | `inputs/calendar.rs` | Horizontal month strip spring, gliding selection disc, civil date math, and keyboard 2D grid navigation |
| `date-picker` | `DatePicker` | `inputs/date_picker.rs` | Popover calendar field with directional date value roll, footer confirmation, and non-closing Clear action |
| `date-range-picker` | `DateRangePicker`, `DateRange` | `inputs/date_range_picker.rs` | Scrollable preset rail + dual-month grid with cross-month continuous highlight bars, gliding start/end discs, and Apply/Cancel footer |
| `time-picker` | `TimePicker`, `TimeFormat` | `inputs/time_picker.rs` | 12h/24h time slot listbox with keyboard walking and parser |
| `color-picker` | `ColorPicker`, `ColorModel` | `inputs/color_picker.rs` | Interactive 2D SV canvas, Hue & Alpha sliders, HEX/RGB/HSL/OKLCH model switcher, swatch presets, and live WCAG contrast grade (`AAA`/`AA`) |
| `inline-edit` | `InlineEdit` | `inputs/inline_edit.rs` | Click-to-edit typography that morphs into an input with Save/Cancel and validation rollback |
| `mention-input` | `MentionInput`, `MentionCandidate` | `inputs/mention_input.rs` | `@` and `#` trigger detection, prefix-ranked floating suggestion menu, and token span reconciliation |
| `file-dropzone` | `FileDropzone`, `DropzoneFile` | `inputs/file_dropzone.rs` | Native OS file picker dialog (`prompt_for_paths`) + external file & directory drag-and-drop (`ExternalPaths`), extension/size validation, upload progress |
| `signature-pad` | `SignaturePad`, `InkStroke` | `inputs/signature_pad.rs` | Velocity-sensitive variable-width ink strokes, global outside-release capture, undo/redo replay, ink color/width controls, and `signature_to_svg` export |
| `billing-toggle` | `BillingToggle`, `BillingCycle` | `inputs/billing_toggle.rs` | Monthly/Annual switch with animated discount badge and rolling price display |
| `rich-text-editor` | `RichTextEditor` | `inputs/rich_text_editor.rs` | Formatting toolbar, `/` slash command menu, Markdown & HTML round-trip serializer, and safe URL normalization |
### 3. Overlays & Modals (`crates/arc-ui/src/overlay/`) — 9 Components
| Registry ID | Rust Struct / API | Source File | Key Capabilities & Physics |
| :--- | :--- | :--- | :--- |
| `tooltip` | `Tooltip`, `TooltipSide` | `overlay/tooltip.rs` | `250ms` cold-start delay, instant warm-window handoff across sibling triggers, directional rise spring |
| `popover` | `Popover` | `overlay/popover.rs` | Anchored floating card with fast enter fade, snappy slide spring, and outside-click dismissal |
| `hover-card` | `HoverCard`, `HoverCardRow` | `overlay/hover_card.rs` | Rich preview card on pointer dwell with staggered row entrance |
| `dropdown-menu` | `DropdownMenu`, `DropdownMenuItem` | `overlay/dropdown_menu.rs` | Loop keyboard navigation skipping disabled items, shortcut hints, and 4-item stagger cap |
| `context-menu` | `ContextMenu`, `ContextMenuItem` | `overlay/context_menu.rs` | Right-click cursor-positioned menu with viewport edge clamping and Home/End navigation |
| `user-menu` | `UserMenu`, `UserStatus` | `overlay/user_menu.rs` | Account avatar trigger with online status switcher, theme picker, and persistent open state on status toggle |
| `dialog` | `Dialog` | `overlay/dialog.rs` | Modal backdrop dim, spring-mounted card, Escape/outside dismissal, and action swap confirmation |
| `drawer` | `Drawer`, `DrawerSide` | `overlay/drawer.rs` | 4-edge (`Left`, `Right`, `Top`, `Bottom`) slide-over sheet with drag-to-dismiss rubber-banding and late shadow fade |
| `bottom-sheet` | `BottomSheet`, `BottomSheetDetent` | `overlay/bottom_sheet.rs` | Multi-detent (`Peek`, `Half`, `Full`) draggable sheet with grabber handle and velocity projection |
### 4. Disclosure, Navigation & Containers (`crates/arc-ui/src/disclosure/`) — 8 Components
| Registry ID | Rust Struct / API | Source File | Key Capabilities & Physics |
| :--- | :--- | :--- | :--- |
| `tabs` | `Tabs`, `TabItem` | `disclosure/tabs.rs` | Shared-layout active pill indicator (`spring.morph`), horizontal overflow scroll controls, keyboard roving focus |
| `accordion` | `Accordion`, `AccordionItem` | `disclosure/accordion.rs` | Single or multiple collapsible sections with smooth height spring and `-6px → 0px` content glide |
| `expandable-card` | `ExpandableCard` | `disclosure/expandable_card.rs` | Morphing summary-to-detail card with `120ms` open content delay and `60ms` close box hold |
| `expandable-text` | `ExpandableText` | `disclosure/expandable_text.rs` | Distance-scaled height expansion with crossfading "Show more / Show less" toggle and bottom fade |
| `scroll-area` | `ScrollArea`, `ScrollAxis` | `disclosure/scroll_area.rs` | Custom auto-hiding scrollbars, proportional edge fade masks, wheel event isolation, and `Shift + Wheel` horizontal scrolling |
| `resizable-panels` | `ResizablePanels`, `PanelSpec` | `disclosure/resizable_panels.rs` | Draggable split-pane divider with `44px` rubber-band asymptote and collapsible snap threshold |
| `breadcrumb` | `Breadcrumb`, `BreadcrumbItem` | `disclosure/breadcrumb.rs` | Collapsible middle ellipsis trail with interactive path navigation and animated segment insertion |
| `pagination` | `Pagination` | `disclosure/pagination.rs` | Sliding page window, ellipsis jumps, Prev/Next boundary disabling, and resting elevation mark |
### 5. Feedback, Progress & Status (`crates/arc-ui/src/feedback/`) — 12 Components
| Registry ID | Rust Struct / API | Source File | Key Capabilities & Physics |
| :--- | :--- | :--- | :--- |
| `toast` | `Toast`, `ToastTone` | `feedback/toast.rs` | Standalone notification banner with swipe-to-dismiss velocity release, action button, and height collapse |
| `toast-stack` | `ToastStack`, `ToastItem` | `feedback/toast_stack.rs` | 3D-stacked notification queue that fans out on hover, pauses auto-dismiss timers, and supports inline undo morphing |
| `alert` | `Alert`, `AlertTone` | `feedback/alert.rs` | Semantic callout (`Info`, `Success`, `Warning`, `Danger`) with animated dismiss collapse |
| `badge` | `Badge`, `BadgeTone` | `feedback/badge.rs` | Hidden-sizer natural width measurement + smooth width morphing when label text changes |
| `progress` | `Progress` | `feedback/progress.rs` | Spring-interpolated fractional fill bar with percentage readout |
| `skeleton` | `Skeleton` | `feedback/skeleton.rs` | Synchronized pulse dimming cycle with crossfade swap when live content arrives |
| `stepper` | `Stepper`, `StepperStep` | `feedback/stepper.rs` | Horizontal/vertical progress indicator with `45ms` cascading connectors, arrival halo ring, drawn check/alert glyphs, and completed-step revisit |
| `countdown` | `Countdown`, `CountdownVariant` | `feedback/countdown.rs` | Shortest-path base-6/3/10 modular digit wheels, largest-unit overflow absorption, `Large`/`Compact` variants, and pulsing live morph at zero |
| `usage-meter` | `UsageMeter`, `UsageSegment` | `feedback/usage_meter.rs` | Monochromatic 4-step segments, `2px` coupled reflow, `45°` overage hatch with limit hairline, and interactive legend spotlight ticker |
| `onboarding-checklist` | `OnboardingChecklist`, `OnboardingStep` | `feedback/onboarding_checklist.rs` | `40px` progress ring with drawn center check, `720ms` strikethrough settle, auto-advancing panel handoff, and completed disclosure group |
| `announcement-bar` | `AnnouncementBar`, `AnnouncementItem` | `feedback/announcement_bar.rs` | Rotating vertical banner with `20px` hover-pausing ring clock, inline live countdown, neutral/inverted tones, and remembered dismissal |
| `cookie-consent` | `CookieConsent`, `CookieCategory` | `feedback/cookie_consent.rs` | Single floating surface morphing across `Bar` (`660px`) ↔ `Panel` (`420px`) ↔ `Chip` (`44px`) on asymmetric `0.46s`/`0.38s` springs with versioned persistence |
### 6. Data Display (`crates/arc-ui/src/data/`) — 2 Components
| Registry ID | Rust Struct / API | Source File | Key Capabilities & Physics |
| :--- | :--- | :--- | :--- |
| `avatar` | `Avatar`, `AvatarStatus` | `data/avatar.rs` | Automatic 2-letter uppercase initials extraction, accent background, and online/busy/offline status dot |
| `avatar-group` | `AvatarGroup` | `data/avatar_group.rs` | Overlapping avatar stack with hover spread and `+N` overflow counter pill |
### 7. Typography & Text Motion (`crates/arc-ui/src/text/`) — 6 Components
| Registry ID | Rust Struct / API | Source File | Key Capabilities & Physics |
| :--- | :--- | :--- | :--- |
| `animated-counter` | `AnimatedCounter` | `text/animated_counter.rs` | Odometer digit wheels with place-value keying, thousand separators, and `InViewTracker` trigger |
| `slot-text` | `SlotText` | `text/slot_text.rs` | Per-character deterministic alphabet/digit reels with staggered landing curve (`cubic-bezier(.12,.8,.16,1)`) |
| `text-reveal` | `TextReveal` | `text/text_reveal.rs` | Word-by-word 3-track entrance (opacity `0.44s`, blur-fallback `0.58s`, vertical rise `0.76s`) |
| `text-shimmer` | `TextShimmer` | `text/text_shimmer.rs` | Per-glyph travelling highlight bell wave (`1.8s` sweep + `32%` rest) with CJK-aware advance estimation |
| `text-morph` | `TextMorph` | `text/text_morph.rs` | Character-occurrence pairing FLIP morph that retains shared letters and staggers new characters |
| `in-view-title` | `InViewTitle`, `InViewTitleVariant` | `text/in_view_title.rs` | 5 scroll-triggered headline animations (`Word`, `Line`, `Blur`, `Tracking`, `Wipe`) with 45% visibility latch |
### 8. Node & Workflow Editor (`crates/arc-flow-core/` & `crates/arc-flow/`)
| Module | Key Types | Highlights |
| :--- | :--- | :--- |
| `arc-flow-core` | `Graph`, `Node`, `Edge`, `Port`, `PortType`, `GraphOp`, `History`, `Viewport`, `SpatialGrid`, `Clip` | Reversible atomic graph operations, cycle & port-type connection validation, xyflow-compatible Bezier & SmoothStep edge path solver, `O(1)` spatial grid viewport querying, and JSON round-trip persistence. |
| `arc-flow` | `FlowCanvas`, `NodeRenderer` | 4-layer GPU canvas (background grid, cached edges, nodes, selection/wiring overlay), cursor-anchored wheel/pinch zoom, `Shift + Drag` marquee selection, `28px` magnetic port snapping, drag-to-reconnect occupied inputs, and 1,000-node stress test mode. |
---
## Frequently Asked Questions (FAQ for Developers & AI Assistants)
### Q1: What is Arc-rs and how does it relate to `uiarc.dev` and GPUI?
**Arc-rs** is the native Rust port of Elia Kuratli's [Arc component library (`uiarc.dev`)](https://uiarc.dev), built on top of `gpui-kit` (an ecosystem wrapper around Zed's GPU-accelerated **GPUI** framework). While upstream Arc targets React, CSS Modules, and Framer Motion on the web, **Arc-rs** translates every design token, OKLab color mix, spring differential equation, and keyboard accessibility pattern into idiomatic, zero-HTML Rust desktop code.
### Q2: How does Arc-rs handle web CSS properties that GPUI does not natively support (e.g., `filter: blur()`, `backdrop-filter`, or arbitrary 2D `transform: scale()`)?
Per `docs/porting/P0-DECISIONS.md`, Arc-rs implements deterministic native approximations in `arc-motion`:
- **`BlurFallback`**: Translates `filter: blur(px)` into a monotonic opacity curve combined with directional micro-translation, preserving the visual softness of enter/exit transitions without requiring custom GPU post-processing shaders.
- **`scaled_bounds`**: Emulates `transform: scale(s)` around an arbitrary `transform-origin` by computing exact scaled layout `Bounds<Pixels>` and font sizes.
- **Per-Glyph Shimmer**: Replaces `background-clip: text` with per-glyph OKLab highlight interpolation using CJK/ASCII advance width estimation.
### Q3: How does global horizontal scrolling (`Shift + Mouse Wheel`) work in Arc-rs?
All scrollable containers in `arc-gallery` (`gallery-sidebar-scroll`, `gallery-stage-scroll`, `gallery-inspector-scroll`, and `ComponentDocPage` code blocks) as well as the reusable `arc_ui::ScrollArea` component attach an `.on_scroll` listener directly to the `.track_scroll(&ScrollHandle)` container. When `event.modifiers.shift` is active, vertical wheel deltas (`delta.y`) are converted into horizontal scroll offset updates (`handle.set_offset(point(next_x, offset.y))`) and propagation is stopped.
### Q4: How do I add or port a new component to Arc-rs?
Follow the 9-step standard template in `docs/porting/COMPONENT-TEMPLATE.md`:
1. Implement the component struct with builder methods and `RenderOnce` / `Render` in `crates/arc-ui/src/<category>/<name>.rs`.
2. Drive all animations through `arc_motion` (`arc_spring`, `ArcPresence`, `motion_now`) and respect `is_reduced_motion(cx)`.
3. Export the component in `crates/arc-ui/src/<category>/mod.rs` and `crates/arc-ui/src/lib.rs`.
4. Add unit tests and headless `#[gpui_kit::test]` window interaction tests in the component file.
5. Create a gallery story and 15-section bilingual `ComponentDoc` in `apps/arc-gallery/src/stories/<name>.rs` and register it in `apps/arc-gallery/src/stories/mod.rs` and `apps/arc-gallery/src/app.rs`.
---
## Testing & Verification
Arc-rs maintains strict automated verification across all workspace crates:
| Test Suite | Crate | Count | Coverage Focus |
| :--- | :--- | :---: | :--- |
| **Token & Color Math** | `arc-tokens` | 11 | OKLCH/OKLab conversion accuracy, 8 accents in Light/Dark mode, spring spec duration formulas, locale switching |
| **Physics & Motion Engine** | `arc-motion` | 24 | Frame-by-frame ODE spring parity (`< 0.5px` vs Motion), CubicBezier accuracy (`< 0.001`), FLIP shared layout, inertia & rubber-band limits, SVG path morphing, 0.25x slow-motion clock |
| **UI Components** | `arc-ui` | 246 | All 93 P1–P5 components: mouse click/drag, keyboard navigation, ARIA roles, reduced-motion instant settle, controlled/uncontrolled state, edge cases |
| **Flow Graph Kernel** | `arc-flow-core` | 31 | Graph topology, nested world coordinates, reversible ops, atomic batch rollback, undo/redo coalescing, Bezier/SmoothStep geometry, spatial grid queries, alignment & minimap math |
| **Flow Interactive Canvas** | `arc-flow` | 15 | Pan/zoom about cursor, port drag wiring with snap & validation, marquee multi-select, edge hit-testing & reconnection, alignment guides, minimap, controls bar, copy/paste/duplicate, in-node input focus |
| **Gallery Integration** | `arc-gallery` | 2 | Full 92-story render smoke test (light/dark/violet/slow-mo/reduced-motion toggles + toast undo morph) |
| **Total** | **Workspace** | **329** | **100% Passing (`cargo test --workspace`)** |
---
## License & Attribution
- **Arc-rs original code** is licensed under the [MIT License](LICENSE). This does not relicense third-party component ports. GPUI forks retain Apache-2.0; React Bits-derived components retain separate restrictions; the maintainer confirmed additional release authorization on 2026-12-05, without independently reviewed terms or a blanket downstream sublicense. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
- Upstream design, motion specifications, and component architecture are ported from **[Arc (`uiarc.dev`)](https://uiarc.dev)** — Copyright © 2026 Elia Kuratli (MIT License). See [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md) for full attribution details.