API ReferenceDesign Systems
Material Surfaces
Material, Ink, cards, dividers, and avatars.
| Surface | Purpose |
|---|---|
Material | Elevation, tint, shape, and clip shell |
Ink / InkWell / InkResponse | Splash-painted content areas |
Card | Elevated content surface (filled/elevated/outlined) |
CircleAvatar | Circular identity surface |
Divider / VerticalDivider | Hairline separators |
use incular::prelude::*;
use incular::material_prelude::{Divider, Material};
fn main() {
let app = Application::new(|_cx| {
Container::builder()
.padding(EdgeInsets::all(24.0))
.alignment(Alignment::CENTER)
.child(
Column::builder()
.main_axis_size(MainAxisSize::Min)
.spacing(8.0)
.children(Vec::<Widget>::from([
Material::new(Text::new("Elevated"))
.elevation(1.0).into(),
Divider::new().into(),
]))
.build(),
)
.build()
.into()
})
.expect("valid application");
incular::run(app).expect("run application");
}Ink, InkWell, and InkResponse add splash-painted layers; Card comes in
filled / elevated / outlined flavors; CircleAvatar, VerticalDivider,
VisualDensity presets, and MaterialTapTargetSize round out the family — all
with the same consuming-builder shape as the runnable program above.
VisualDensity: STANDARD(0,0) / COMFORTABLE(-1,-1) / COMPACT(-2,-2).
MaterialTapTargetSize: Padded (default, 48px min) / ShrinkWrap.
K_MIN_INTERACTIVE_DIMENSION = 48.
Related: Surfaces.