mirror of
https://github.com/adoyle0/thaw.git
synced 2025-02-08 19:03:09 -05:00
feat: add divider component
This commit is contained in:
parent
d265adfbe6
commit
551f63ffcb
7 changed files with 67 additions and 0 deletions
|
@ -30,6 +30,7 @@ pub fn App() -> impl IntoView {
|
||||||
<Route path="/avatar" view=AvatarPage/>
|
<Route path="/avatar" view=AvatarPage/>
|
||||||
<Route path="/badge" view=BadgePage/>
|
<Route path="/badge" view=BadgePage/>
|
||||||
<Route path="/card" view=CardPage/>
|
<Route path="/card" view=CardPage/>
|
||||||
|
<Route path="/divider" view=DividerPage/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/mobile/tabbar" view=TabbarDemoPage/>
|
<Route path="/mobile/tabbar" view=TabbarDemoPage/>
|
||||||
<Route path="/mobile/nav-bar" view=NavBarDemoPage/>
|
<Route path="/mobile/nav-bar" view=NavBarDemoPage/>
|
||||||
|
|
|
@ -92,6 +92,10 @@ fn gen_menu_data() -> Vec<MenuGroupOption> {
|
||||||
value: "card".into(),
|
value: "card".into(),
|
||||||
label: "Card".into(),
|
label: "Card".into(),
|
||||||
},
|
},
|
||||||
|
MenuItemOption {
|
||||||
|
value: "divider".into(),
|
||||||
|
label: "Divider".into(),
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
MenuGroupOption {
|
MenuGroupOption {
|
||||||
|
|
32
demo/src/pages/divider/mod.rs
Normal file
32
demo/src/pages/divider/mod.rs
Normal file
|
@ -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! {
|
||||||
|
<div style="width: 896px; margin: 0 auto;">
|
||||||
|
<h1>"Checkbox"</h1>
|
||||||
|
<Demo>
|
||||||
|
"top"
|
||||||
|
<Divider />
|
||||||
|
"bottom"
|
||||||
|
<DemoCode
|
||||||
|
slot
|
||||||
|
html=highlight_str!(
|
||||||
|
r#"
|
||||||
|
"top"
|
||||||
|
<Divider />
|
||||||
|
"bottom"
|
||||||
|
"#,
|
||||||
|
"rust"
|
||||||
|
)
|
||||||
|
>
|
||||||
|
|
||||||
|
""
|
||||||
|
</DemoCode>
|
||||||
|
</Demo>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,6 +7,7 @@ mod card;
|
||||||
mod checkbox;
|
mod checkbox;
|
||||||
mod color_picker;
|
mod color_picker;
|
||||||
mod components;
|
mod components;
|
||||||
|
mod divider;
|
||||||
mod grid;
|
mod grid;
|
||||||
mod home;
|
mod home;
|
||||||
mod image;
|
mod image;
|
||||||
|
@ -32,6 +33,7 @@ pub use card::*;
|
||||||
pub use checkbox::*;
|
pub use checkbox::*;
|
||||||
pub use color_picker::*;
|
pub use color_picker::*;
|
||||||
pub use components::*;
|
pub use components::*;
|
||||||
|
pub use divider::*;
|
||||||
pub use grid::*;
|
pub use grid::*;
|
||||||
pub use home::*;
|
pub use home::*;
|
||||||
pub use image::*;
|
pub use image::*;
|
||||||
|
|
13
src/divider/divider.css
Normal file
13
src/divider/divider.css
Normal file
|
@ -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%;
|
||||||
|
}
|
13
src/divider/mod.rs
Normal file
13
src/divider/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
use leptos::*;
|
||||||
|
|
||||||
|
use crate::mount_style;
|
||||||
|
|
||||||
|
#[component]
|
||||||
|
pub fn Divider() -> impl IntoView {
|
||||||
|
mount_style("divider", include_str!("./divider.css"));
|
||||||
|
view! {
|
||||||
|
<div class="melt-divider">
|
||||||
|
<div class="melt-divider__line"></div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,6 +8,7 @@ mod checkbox;
|
||||||
mod code;
|
mod code;
|
||||||
mod color_picker;
|
mod color_picker;
|
||||||
mod components;
|
mod components;
|
||||||
|
mod divider;
|
||||||
mod grid;
|
mod grid;
|
||||||
mod icon;
|
mod icon;
|
||||||
mod image;
|
mod image;
|
||||||
|
@ -36,6 +37,7 @@ pub use card::*;
|
||||||
pub use checkbox::*;
|
pub use checkbox::*;
|
||||||
pub use code::*;
|
pub use code::*;
|
||||||
pub use color_picker::*;
|
pub use color_picker::*;
|
||||||
|
pub use divider::*;
|
||||||
pub use grid::*;
|
pub use grid::*;
|
||||||
pub use icon::*;
|
pub use icon::*;
|
||||||
pub use image::*;
|
pub use image::*;
|
||||||
|
|
Loading…
Add table
Reference in a new issue