English | 简体中文
Tempo UI is a modern, cross-platform component library for Rust + Slint applications. It focuses on restrained geometry, crisp 1px borders, layered light/dark surfaces, and cohesive decelerated motion across both desktop and mobile viewports.
- Restrained Geometry & Soft Layered Surfaces: Compact
4px / 6px / 8px / 10pxradii and crisp hairline borders. Both light and dark themes avoid harsh pure white (#FFFFFF) and pure black (#000000), separating canvas, navigation rail, cards, and elevated overlays cleanly. - Unified Desktop & Mobile Adaptation:
TempoNavigationShellseamlessly adapts between an expanded desktop sidebar, a compact navigation rail (with bottom-pinned unifiedfooter-destinations), and a mobile bottom bar.TempoToastHostrenders as a top-right notification card on desktop and a compact bottom bar on mobile; pickers andTempoTransferautomatically adapt to narrow viewports. - Cohesive Motion System: Standardized decelerated easing across transitions, drawers, dialogs, dropdowns, and sliding controls, with
TempoRouteTransition(none/fade-through/shared-axis-x/shared-axis-y) and globalTempoMotionSettings.reducedsupport. - System Fonts and CJK Fallbacks: Follow Android and Linux desktop font preferences, with missing-glyph fallbacks for Simplified and Traditional Chinese, Japanese, and Korean.
| Category | Components |
|---|---|
| Actions & Buttons | TempoButton (7 semantic variants), TempoIconButton, TempoSplitButton, TempoFloatingActionButton, TempoLink, TempoMenuButton |
| Inputs & Selection | TempoTextField (clear button & password reveal), TempoTextArea, TempoSearch, TempoComboBox, TempoDatePicker, TempoTimePicker, TempoCheckBox, TempoRadioButton, TempoSwitch, TempoSpinBox, TempoSlider, TempoRangeSlider, TempoRate, TempoChip, TempoColorPicker, TempoSelectionTile, TempoRadioTile, TempoSwitchTile, TempoSegmentedControl |
| Navigation & Layout | TempoNavigationShell, TempoNav, TempoAppBar, TempoPageHead, TempoPage, TempoAdaptiveSplit, TempoSplitPane, TempoTabBar, TempoButtonGroupTabBar, TempoBreadcrumb, TempoPagination, TempoStepBar, TempoIndexedStack, TempoVirtualList, TempoReorderList, TempoRefresh |
| Feedback & Overlays | TempoDialog, TempoSheet, TempoDrawer, TempoPopover, TempoImageViewer, TempoToastHost, TempoInfoBar, TempoBanner, TempoProgressBar, TempoProgressRing, TempoLoadingOverlay, TempoEmptyState, TempoSkeleton |
| Data & Display | TempoSurface, TempoClickableSurface, TempoCard, TempoSection, TempoTile, TempoExpander, TempoTable, TempoTreeView, TempoCalendar, TempoCarousel, TempoTransfer, TempoTimeline, TempoStatCard, TempoKeyValue, TempoAvatar, TempoBadge, TempoTag, TempoStatusDot, TempoKeyCap, TempoDivider |
Requires Rust 1.95+ and a graphical session:
cargo run --release --locked -p tempo-ui-showcasePreview presets:
cargo run -p tempo-ui-showcase -- --dark # Dark desktop
cargo run -p tempo-ui-showcase -- --wide # Wide expanded sidebar & three-pane split
cargo run -p tempo-ui-showcase -- --compact # Compact mobile light
cargo run -p tempo-ui-showcase -- --compact --dark # Compact mobile darkBoth FemtoVG and software rendering are supported (SLINT_BACKEND=winit-software).
Tempo UI requires Rust 1.95 or newer. Add it as a build dependency so the Slint compiler can find its components.
[build-dependencies]
tempo-ui = "0.5.1"
slint-build = "=1.19.1"Register @tempo-ui in your application's build.rs.
use std::collections::HashMap;
fn main() {
let libraries = HashMap::from([("tempo-ui".into(), tempo_ui::slint_library_path())]);
let config = slint_build::CompilerConfiguration::new().with_library_paths(libraries);
slint_build::compile_with_config("ui/main.slint", config).unwrap();
}To use the optional system font and CJK support, also add tempo-ui = { version = "0.5.1", features = ["cjk-font-fallback"] } under [dependencies]. Configure fonts on the UI thread before initializing Slint.
fn main() -> Result<(), Box<dyn std::error::Error>> {
tempo_ui::fonts::configure_system_fonts()?;
// Create and run your Slint window...
Ok(())
}On Android, call this inside android_main before slint::android::init(app) (or before slint::platform::set_platform(...) when setting up the backend manually). TempoUI uses the Android 10+ system matcher and also follows a readable vendor font redirect when the ROM exposes one. If neither is available, it falls back to discoverable system fonts. On Linux, TempoUI reads the KDE or supported GNOME-family desktop preference when available, and otherwise uses Fontconfig.
The choice is read at startup. To override it, set TEMPO_UI_FONT_FAMILY to an installed family or SLINT_DEFAULT_FONT to a readable font file before launch. A window's explicit default-font-family or a control's font-family still takes precedence. Existing calls to configure_cjk_fallbacks() get the same behavior.
Import components directly in .slint:
import { TempoButton, TempoCard, TempoTheme } from "@tempo-ui";
export component App inherits Window {
background: TempoTheme.background;
VerticalLayout {
padding: 16px;
TempoCard {
title: "Hello Tempo UI";
TempoButton { label: "Continue"; }
}
}
}Use TempoWindow to read the live system insets and pass them to the top-level layout.
import { TempoWindow, TempoSafeArea } from "@tempo-ui";
export component App inherits TempoWindow {
TempoSafeArea {
insets: root.content-insets;
Text { text: "Hello Tempo UI"; }
}
}Use either this wrapper for standalone content or insets: root.content-insets; on a top-level TempoNavigationShell. Do not inset both. For explicitly sized children, use the wrapper’s content-width and content-height. The window background stays full-bleed and the insets are normally zero on desktop.
Wrap the window content in TempoBackHandler, forward the window’s focus to it, and handle go-back with your route stack. Return false at the root to allow the platform’s default action. Keep modal focus in the popup so it closes first.
Mobile defaults to TempoMotionSettings.lightweight: sheets, dialogs, toasts and route changes retain short transitions without animating full-window opacity. Android typography uses the system font scale via TempoTokens.text-scale(1rem); desktop font sizes are unchanged.
cargo test --workspace --locked
./scripts/check.sh- Special thanks to HandyControl for inspiring many of our desktop control patterns, semantic color hierarchies, restrained corner proportions, and notification ergonomics.
- Thanks to Microsoft Fluent Design and Fluent System Icons for interaction inspiration and the icon set.
- Thanks to Material Design 3 for motion principles and the Slint team for the cross-platform UI toolkit.
Tempo UI is licensed under the MIT License. Third-party notices are available in LICENSES.


