Components / TileLayout

TileLayout

A dashboard of tiles to drag and resize.

Example

The component itself, running in WebAssembly, beside its code in a playground. Try it.

Code

use ravenrs::prelude::*;

fn tile_layout() -> impl View {
    let spots = State::new(vec![TileSpot::new("sales", 2, 1)]);
    TileLayout::new(spots.binding())
        .columns(3)
        .row_height(110.0)
        .tile(Tile::new("sales", "Sales", Stat::new("This month", "R$ 48,200")))
        .tile(
            Tile::new("bills", "Bills", Stat::new("Open", "12"))
                .accessory(Badge::new("3 late").tone(Tone::Danger)),
        )
        .tile(Tile::new("stock", "Stock", Stat::new("Items", "1,204")))
        .tile(Tile::new("people", "People", Stat::new("Active", "37")))
}

Open in the playground, with every example →

Full API of TileLayout →