diff --git a/demo/src/app.rs b/demo/src/app.rs index 5bd39f0..1f4f65d 100644 --- a/demo/src/app.rs +++ b/demo/src/app.rs @@ -30,6 +30,7 @@ pub fn App() -> impl IntoView { + diff --git a/demo/src/pages/components.rs b/demo/src/pages/components.rs index c8bfc24..c22e713 100644 --- a/demo/src/pages/components.rs +++ b/demo/src/pages/components.rs @@ -92,6 +92,10 @@ fn gen_menu_data() -> Vec { value: "card".into(), label: "Card".into(), }, + MenuItemOption { + value: "divider".into(), + label: "Divider".into(), + }, ], }, MenuGroupOption { diff --git a/demo/src/pages/divider/mod.rs b/demo/src/pages/divider/mod.rs new file mode 100644 index 0000000..394e704 --- /dev/null +++ b/demo/src/pages/divider/mod.rs @@ -0,0 +1,32 @@ +use crate::components::{Demo, DemoCode}; +use leptos::*; +use melt_ui::*; +use prisms::highlight_str; + +#[component] +pub fn DividerPage() -> impl IntoView { + view! { +
+

"Checkbox"

+ + "top" + + "bottom" + + "bottom" + "#, + "rust" + ) + > + + "" + + +
+ } +} diff --git a/demo/src/pages/mod.rs b/demo/src/pages/mod.rs index adad1bd..c7fcff6 100644 --- a/demo/src/pages/mod.rs +++ b/demo/src/pages/mod.rs @@ -7,6 +7,7 @@ mod card; mod checkbox; mod color_picker; mod components; +mod divider; mod grid; mod home; mod image; @@ -32,6 +33,7 @@ pub use card::*; pub use checkbox::*; pub use color_picker::*; pub use components::*; +pub use divider::*; pub use grid::*; pub use home::*; pub use image::*; diff --git a/src/divider/divider.css b/src/divider/divider.css new file mode 100644 index 0000000..0059f4a --- /dev/null +++ b/src/divider/divider.css @@ -0,0 +1,13 @@ + +.melt-divider { + position: relative; + display: flex; + width: 100%; + margin: 1.5rem 0; +} + +.melt-divider__line { + background-color: #efeff5; + height: 1px; + width: 100%; +} diff --git a/src/divider/mod.rs b/src/divider/mod.rs new file mode 100644 index 0000000..00ffc5d --- /dev/null +++ b/src/divider/mod.rs @@ -0,0 +1,13 @@ +use leptos::*; + +use crate::mount_style; + +#[component] +pub fn Divider() -> impl IntoView { + mount_style("divider", include_str!("./divider.css")); + view! { +
+
+
+ } +} diff --git a/src/lib.rs b/src/lib.rs index 713a235..0e69c83 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,6 +8,7 @@ mod checkbox; mod code; mod color_picker; mod components; +mod divider; mod grid; mod icon; mod image; @@ -36,6 +37,7 @@ pub use card::*; pub use checkbox::*; pub use code::*; pub use color_picker::*; +pub use divider::*; pub use grid::*; pub use icon::*; pub use image::*;