Repository navigation
Installation
Blinc requires Rust 1.89 or newer and a GPU supported by Vulkan, Metal or DirectX 12. On Linux, OpenGL 3.3 or OpenGL ES 3.0 also works. Browser applications use WebAssembly and WebGPU.
[dependencies]
blinc = { version = "0.6", features = ["cn"] }The blinc package exposes the framework through blinc::app,
blinc::layout, blinc::core, blinc::theme and the other API modules.
blinc::prelude::* imports the common builders, core types and reactive
functions. The cn feature adds the component library.
Create src/main.rs:
use blinc::{app::windowed::WindowedApp, cn, prelude::*};
fn main() -> Result<()> {
let theme = cn::cn_bundle().with_css(r#"
.welcome {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: var(--background);
}
"#);
WindowedApp::run_with_theme(
WindowConfig::default(), theme, ColorScheme::Dark,
|_ctx| div().class("welcome").child(cn::h1("Your workspace")),
)
}Run cargo run. A window opens using Blinc's built-in theme and the
application's stylesheet. Continue with Your First App to add
Signals, Computeds and interactive components.
Desktop windowing is enabled by default. Other platforms disable defaults and select their runner:
# Browser application
blinc = { version = "0.6", default-features = false, features = ["web", "cn"] }
# Android application
blinc = { version = "0.6", default-features = false, features = ["android", "cn"] }
# iOS application
blinc = { version = "0.6", default-features = false, features = ["ios", "cn"] }| Feature | API |
|---|---|
windowed |
Desktop runner; enabled by default |
web |
Browser runner and blinc::platform_web helpers |
android, ios
|
Mobile runners |
cn |
Components through blinc::cn
|
svg |
SVG loading and rasterization through blinc::svg
|
icons |
Lucide icon data and SVG helpers through blinc::icons
|
media |
blinc::media and the layout playback widgets |
dialogs, tray, notifications, hotkeys
|
Desktop system integrations |
windowed-full |
Desktop runner and all four system integrations |
clipboard-image |
Image clipboard support |
svg-raster-images |
SVG module with embedded raster decoding |
icons-registry |
Icons module with name-based lookup |
theme-watcher |
System colour-scheme watcher |
hot-reload |
Application hot reload |
For headless rendering, use default-features = false without a runner
feature. Add icons, svg or media when using the corresponding examples
in this book. Module flags expose the public API; the application renderer
also uses SVG internally, and components depend on icon data.
macOS uses Metal. Windows uses DirectX 12 or Vulkan with supported GPU drivers. Linux uses Vulkan. Where Vulkan has no GPU driver, Linux uses an OpenGL device that meets the limits of WebGL2. A GPU without uniform buffers, such as Intel Ironlake, does not meet them. On OpenGL below 4.3 or ES 3.1, particles and compute flows do not run.
Linux needs its graphics and window-system development libraries. For a Vulkan setup:
# Ubuntu / Debian
sudo apt install libvulkan-dev
# Fedora
sudo dnf install vulkan-devel
# Arch
sudo pacman -S vulkan-icd-loaderPlatform-specific setup is covered in the Web, Android and iOS guides.
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