Overview
Architecture
Dioxus Native uses:- Blitz: Custom HTML/CSS layout engine
- Vello: GPU-accelerated 2D graphics via WGPU
- Winit: Cross-platform window management
- Native Rendering: Direct GPU rendering, no browser engine
Quick Start
Add the native dependency:Configuration
Customize the native renderer:GPU Configuration
Configure WGPU features and limits:Styling with CSS
Blitz supports modern CSS layout:Flexbox Layout
Grid Layout
Custom Painting
Draw custom graphics using Vello:Vector Graphics
Performance
GPU Acceleration
All rendering happens on the GPU:- Vector graphics rasterized on GPU
- Text rendering via GPU
- Hardware-accelerated compositing
- Efficient batching and caching
Layout Performance
Blitz provides fast layout:- CSS parsing and style computation
- Flexbox layout algorithm
- Incremental layout updates
- Efficient DOM tree management
Benchmarks
Typical performance metrics:- Frame time: <1ms for simple UIs
- Startup time: <100ms
- Memory: Lower than webview-based apps
- Bundle size: ~10-15MB
Window Management
Access window features:Supported CSS Features
Blitz supports:Layout
- Flexbox (display: flex)
- Grid (display: grid)
- Block layout
- Inline layout
- Absolute/relative positioning
Styling
- Colors (hex, rgb, rgba, named)
- Backgrounds (solid colors, gradients)
- Borders (width, style, color, radius)
- Padding and margins
- Box shadows
- Text properties (font, size, weight, color)
Not Yet Supported
- Full CSS 3 selectors
- Animations and transitions (coming soon)
- Complex transforms
- Some advanced CSS 3 features
Event Handling
Native apps support standard events:Asset Loading
Load images and assets:Text Rendering
Vello provides high-quality text rendering:Platform Support
Windows
- Uses DirectX 12 via WGPU
- Full hardware acceleration
- Native window decoration
macOS
- Uses Metal via WGPU
- Retina display support
- Native window features
Linux
- Uses Vulkan via WGPU
- Wayland and X11 support
- Hardware acceleration
iOS/Android
- Experimental support
- Uses platform-native GPU APIs
Debugging
Enable Tracing
GPU Debugging
Enable WGPU validation:Layout Debugging
Visualize layout boxes:Comparison with Desktop
| Feature | Native | Desktop |
|---|---|---|
| Rendering | GPU (Vello) | WebView |
| Bundle Size | Smaller | Larger |
| Startup Time | Faster | Slower |
| CSS Support | Subset | Full |
| Web APIs | No | Yes |
| Performance | Higher | Good |
| Maturity | Experimental | Stable |
When to Use Native
Choose native rendering when:- Maximum performance is critical
- You want smaller binaries
- You don’t need full web API compatibility
- You’re building graphics-intensive apps
- You want lower resource usage
- You need full CSS/HTML support
- You want web API access
- You need maximum compatibility
- You’re porting a web app
Limitations
Current limitations:- CSS support is not complete
- No JavaScript execution
- Limited web API access
- Experimental status
Roadmap
- Full CSS 3 support
- Animation and transition support
- More text rendering features
- Improved accessibility
- Better debugging tools
Next Steps
- Desktop Platform - WebView-based desktop apps
- Styling - Advanced CSS techniques
- Performance - Optimization tips