Backer
A library for straight-forward UI layout.
Dependency free & framework-agnostic. Backer can be used in an index-based layout approach or with inline drawing code.
This library only implements layout & could be integrated with a range of UI crates.
Features
- Declarative API
- Minimal interface
- Single pass layout
Preview
Backer relies on simple rules that can compose to create complex, flexible layouts.
// #1
row_spaced
.pad
// #2
column_spaced
.pad
// #3 & #4
column_spaced
.pad
Quick Start
1. Create a Layout struct with your layout function.
use Layout;
use Node;
let layout = new;
2. Combine nodes to define your layout
3. Implement a draw node
For reuse, you can construct your drawable in a function
4. Run your layout
// UI libraries generally will expose methods to get the available screen size
// In a real implementation this should use the real screen size!
let available_area = Area ;
let mut my_state = new;
let layout = new;
// Perform layout & draw all of your drawable nodes.
layout.draw;
Status
The crate is currently usable but is very new! Currently lacks testing & will likely publish breaking changes often.
Contributions are always welcome 🤗