Components / DaySeparator
DaySeparator
A line with a word in the middle that divides a list by day.
Example
The component itself, running in WebAssembly, beside its code in a playground. Try it.
Code
use ravenrs::prelude::*;
fn day_separator() -> impl View {
let today = Date::new(2026, 11, 4).unwrap_or_else(|| Date::from_days(0));
VStack::new((
DaySeparator::of(today, today),
DaySeparator::of(today.add_days(-1), today),
DaySeparator::new("Last week"),
))
.spacing(16.0)
.align(Align::Stretch)
}