diff --git a/demo/src/app.rs b/demo/src/app.rs index 15be80f..a6855d2 100644 --- a/demo/src/app.rs +++ b/demo/src/app.rs @@ -37,6 +37,8 @@ pub fn App() -> impl IntoView { + + diff --git a/demo/src/pages/components.rs b/demo/src/pages/components.rs index 85d4a55..22ffa7a 100644 --- a/demo/src/pages/components.rs +++ b/demo/src/pages/components.rs @@ -137,6 +137,10 @@ fn gen_menu_data() -> Vec { value: "slider".into(), label: "Slider".into(), }, + MenuItemOption { + value: "switch".into(), + label: "Switch".into(), + }, ], }, MenuGroupOption { @@ -184,6 +188,10 @@ fn gen_menu_data() -> Vec { value: "modal".into(), label: "Modal".into(), }, + MenuItemOption { + value: "skeleton".into(), + label: "Skeleton".into(), + }, ], }, MenuGroupOption { diff --git a/demo/src/pages/mod.rs b/demo/src/pages/mod.rs index d94c74d..22b2feb 100644 --- a/demo/src/pages/mod.rs +++ b/demo/src/pages/mod.rs @@ -21,8 +21,10 @@ mod modal; mod nav_bar; mod radio; mod select; +mod skeleton; mod slider; mod space; +mod switch; mod tabbar; mod table; mod tabs; @@ -51,8 +53,10 @@ pub use modal::*; pub use nav_bar::*; pub use radio::*; pub use select::*; +pub use skeleton::*; pub use slider::*; pub use space::*; +pub use switch::*; pub use tabbar::*; pub use table::*; pub use tabs::*; diff --git a/demo/src/pages/skeleton/mod.rs b/demo/src/pages/skeleton/mod.rs new file mode 100644 index 0000000..13b91bb --- /dev/null +++ b/demo/src/pages/skeleton/mod.rs @@ -0,0 +1,30 @@ +use crate::components::{Demo, DemoCode}; +use leptos::*; +use melt_ui::*; +use prisms::highlight_str; + +#[component] +pub fn SkeletonPage() -> impl IntoView { + view! { +
+

"Skeleton"

+ + + + + + "#, + "rust" + ) + > + + "" + + +
+ } +} diff --git a/demo/src/pages/switch/mod.rs b/demo/src/pages/switch/mod.rs new file mode 100644 index 0000000..749cda9 --- /dev/null +++ b/demo/src/pages/switch/mod.rs @@ -0,0 +1,32 @@ +use crate::components::{Demo, DemoCode}; +use leptos::*; +use melt_ui::*; +use prisms::highlight_str; + +#[component] +pub fn SwitchPage() -> impl IntoView { + let value = create_rw_signal(false); + view! { +
+

"Switch"

+ + + + } + "#, + "rust" + ) + > + + "" + + +
+ } +} diff --git a/src/skeleton/mod.rs b/src/skeleton/mod.rs index 2fc0a03..3843f3d 100644 --- a/src/skeleton/mod.rs +++ b/src/skeleton/mod.rs @@ -1,6 +1,6 @@ mod theme; -use crate::{theme::use_theme, Theme}; +use crate::{mount_style, theme::use_theme, Theme}; use leptos::*; pub use theme::SkeletionTheme; @@ -11,6 +11,7 @@ pub fn Skeleton( #[prop(optional, into)] width: Option>, #[prop(optional, into)] height: Option>, ) -> impl IntoView { + mount_style("skeleton", include_str!("./skeleton.css")); let theme = use_theme(Theme::light); let css_vars = create_memo(move |_| { let mut css_vars = String::new();