Repository navigation
System Integration
Blinc provides APIs for common desktop system features: file dialogs, system tray, notifications, drag-and-drop, and global keyboard shortcuts.
Each surface is a separate blinc feature so apps that don't use them don't pay the transitive dep cost (each pulls 25–130 crates on Linux):
| Feature | Module | Backed by |
|---|---|---|
dialogs |
blinc::app::dialog |
rfd |
tray |
blinc::app::tray |
tray-icon + muda
|
notifications |
blinc::app::notify |
notify-rust |
hotkeys |
blinc::app::hotkey |
global-hotkey |
Enable in Cargo.toml:
[dependencies]
blinc = { version = "0.6", features = ["dialogs", "tray", "notifications", "hotkeys"] }Or use the umbrella windowed-full to enable all four:
blinc = { version = "0.6", features = ["windowed-full"] }Without the corresponding feature, the matching module's APIs compile to no-op stubs — calls return None / silently do nothing — so you can prototype against them and turn the flag on later.
Open, save, and folder picker dialogs via the rfd crate (requires the dialogs feature):
use blinc::app::dialog::{open_file, save_file, pick_folder, FileFilter};
// Open a file
if let Some(path) = open_file()
.title("Open Image")
.filter(FileFilter::new("Images").ext("png").ext("jpg"))
.filter(FileFilter::new("All Files").ext("*"))
.pick()
{
println!("Selected: {}", path.display());
}
// Open multiple files
let paths = open_file()
.title("Select Files")
.filter(FileFilter::new("Rust").ext("rs"))
.pick_many();
// Save dialog
if let Some(path) = save_file()
.title("Save As")
.file_name("untitled.txt")
.filter(FileFilter::new("Text").ext("txt"))
.save()
{
println!("Save to: {}", path.display());
}
// Folder picker
if let Some(dir) = pick_folder()
.title("Choose Directory")
.pick()
{
println!("Directory: {}", dir.display());
}Create a tray icon with a context menu for background apps:
use blinc::app::tray::{TrayIconBuilder, TrayMenuItem};
let _tray = TrayIconBuilder::new()
.tooltip("My App v1.0")
.menu(vec![
TrayMenuItem::item("Show Window", || {
// bring window to front
}),
TrayMenuItem::separator(),
TrayMenuItem::submenu("Recent", vec![
TrayMenuItem::item("File 1", || {}),
TrayMenuItem::item("File 2", || {}),
]),
TrayMenuItem::separator(),
TrayMenuItem::item("Quit", || std::process::exit(0)),
])
.build();
// Keep `_tray` alive — dropping it removes the iconYou can provide a custom icon:
let rgba = vec![100, 150, 255, 255].repeat(32 * 32); // 32x32 blue icon
TrayIconBuilder::new()
.icon_rgba(rgba, 32, 32)
.tooltip("My App")
.build();Send native desktop notifications:
use blinc::app::notify::Notification;
Notification::new("Download Complete")
.body("Your file has been saved to ~/Downloads")
.show();Register a global file drop handler:
use blinc::app::dnd::{on_file_drop, DropEvent};
on_file_drop(|event| match event {
DropEvent::Hovered(paths) => println!("Dragging: {:?}", paths),
DropEvent::Dropped(paths) => {
for path in paths {
println!("Dropped: {}", path.display());
}
}
DropEvent::Cancelled => println!("Drag cancelled"),
});Make any element a drop target:
div()
.w(300.0).h(200.0)
.bg(Color::rgb(0.15, 0.15, 0.2))
.rounded(8.0)
.on_file_drop(|ctx| {
println!("File dropped on this element!");
})
.on_file_drag_over(|ctx| {
// Show visual feedback
})
.on_file_drag_leave(|ctx| {
// Remove visual feedback
})
.child(text("Drop files here"))Register system-wide hotkeys that work even when the app isn't focused:
use blinc::app::hotkey::GlobalHotkey;
// Active until `_hotkey` is dropped
let _hotkey = GlobalHotkey::new("Ctrl+Shift+P", || {
println!("Global shortcut triggered!");
});
// macOS uses Cmd
let _hotkey2 = GlobalHotkey::new("Cmd+Shift+Space", || {
println!("Quick search!");
});Accelerator format: Ctrl, Shift, Alt, Cmd/Super + key name (e.g., A, F1, Space, Enter).
Getting Started
Migrating
Mobile Development
Example Gallery
- Example Gallery
- Canvas Element
- Canvas Kit Interactive
- Carousel Demo - Selector API Showcase
- Chrome-Style Tabs
- blinc_cn Components
- Run with
cargo run -p blinc_app_examples --features cn --example cn_pickers_demo. - Code Element
- Complex SVG
- CSS Debug
- CSS Visual Features
- Layer Effects
- Emoji and HTML Entities
- @flow Shader
- Fluid Surface
- Skeleton animation with glTF +
blinc_canvas_kit. - Gpu Pass Demo
- Image CSS Styling
- Image Layer Test
- Keyframe Animation Canvas
- Markdown Editor
- 3D Mesh Demo — renders the Khronos glTF
DamagedHelmetsample model - Motion Demo
- Music Player Glass Card
- Node-editor demo — pre-wired graph with three node types, typed
- Notch Menu Bar
- Overflow Fade
- Overlay System
- Pointer Query
- Rich Text Element
- Rich Text Editor
- Scroll Container
- Semantic @flow
- Sortable
- Stateful API + Signal-bound modifiers demo.
- End-to-end 3D demo wiring Blinc's SceneKit3D renderer up to
- Unified Styling API
- SVG Animation
- Table Builder
- Tabler Icons
- Minimal text positioning test
- Text Input Widgets
- KHR_texture_transform
- Theme System
- Timeline Animation
- Typography
- Wet Glass
- Windowed Application
Web Development
Core Concepts
- Elements & Layout
- Styling & Materials
- CSS Styling
- Theming
- Event Handling
- Accessibility
- State Management
- Lists & Conditional Content
- Element Refs
Animation
Components
Component Library (blinc_cn)
- Overview
- Button
- Card
- Icons
- Typography
- Dialog
- Form Components
- Date, Time and Colour Pickers
- Rich Text Editor
- Code Editor
- Navigation
- Feedback
- Layout
- Data Display
Widgets
- Buttons & Inputs
- Text & Rich Text
- Code Editor
- Scroll Containers
- Virtualized List
- Canvas Drawing
- Gestures
- Notched Surfaces
- Images & SVG
- Audio & Video
- Markdown Rendering
Canvas Kit
Advanced
- Routing & Navigation
- Multi-Window
- System Integration
- Element Query API
- Overlay System
- Custom State Machines
- Pointer Query
- Performance Tips
- Flow Shaders
- 3D Rendering
- Custom GPU Passes
- Hot reloading
Architecture
Contributing