repose_material/material3/
divider.rs1#![allow(non_snake_case)]
2
3use repose_core::*;
4use repose_ui::Box;
5
6use super::*;
7
8#[derive(Clone, Debug)]
10pub struct DividerConfig {
11 pub modifier: Modifier,
12 pub thickness: f32,
13 pub color: Color,
14}
15
16impl Default for DividerConfig {
17 fn default() -> Self {
18 Self {
19 modifier: Modifier::new(),
20 thickness: DividerDefaults::THICKNESS,
21 color: DividerDefaults::color(),
22 }
23 }
24}
25
26pub fn HorizontalDivider(config: DividerConfig) -> View {
29 Box(Modifier::new()
30 .min_width(200.0)
31 .height(config.thickness)
32 .background(config.color)
33 .then(config.modifier))
34}
35
36#[deprecated(since = "0.19.5", note = "renamed to HorizontalDivider")]
37pub fn Divider(config: DividerConfig) -> View {
38 HorizontalDivider(config)
39}
40
41pub fn VerticalDivider(config: DividerConfig) -> View {
43 Box(Modifier::new()
44 .width(config.thickness)
45 .fill_max_height()
46 .background(config.color)
47 .then(config.modifier))
48}