diff --git a/crates/zu-docs/src/views/data_display/badge_page.rs b/crates/zu-docs/src/views/data_display/badge_page.rs index 00714eb81..2c30e020a 100644 --- a/crates/zu-docs/src/views/data_display/badge_page.rs +++ b/crates/zu-docs/src/views/data_display/badge_page.rs @@ -12,29 +12,9 @@ use zuicon_material::Mail; use crate::components::demo_box::DemoBox; -#[function_component(BadgePage)] -pub fn badge_page() -> Html { - // TODO(Shaohua): Add toggle visibility button - // TODO(Shaohua): Add anchor-origin check buttons - - let rectangle = html! { - - }; - let circle = html! { - - }; - +fn create_badge_basic_view() -> Html { html! { -
-

{"Badge"}

- + <>

{"Badge Basic"}

{"Examples of badges containing text, using primary and secondary colors. The badge is applied to its children."}

@@ -42,7 +22,13 @@ pub fn badge_page() -> Html { + + } +} +fn create_color_view() -> Html { + html! { + <>

{"Color"}

{"Use color prop to apply theme palette to component."}

@@ -53,7 +39,13 @@ pub fn badge_page() -> Html { + + } +} +fn create_badge_visibility_view() -> Html { + html! { + <>

{"Badge visibility"}

{"The visibility of badges can be controlled using the invisible prop."}

@@ -67,7 +59,13 @@ pub fn badge_page() -> Html { + + } +} +fn create_maximum_value_view() -> Html { + html! { + <>

{"Maximum value"}

{"You can use the max prop to cap the value of the badge content."}

@@ -81,7 +79,13 @@ pub fn badge_page() -> Html { + + } +} +fn create_dot_badge_view() -> Html { + html! { + <>

{"Dot Badge"}

{"The dot prop changes a badge into a small dot. This can be used as a notification \ that something has changed without giving a count."}

@@ -90,7 +94,27 @@ pub fn badge_page() -> Html { + + } +} + +fn create_badge_overlap_view() -> Html { + let rectangle = html! { + + }; + let circle = html! { + + }; + html! { + <>

{"Badge overlap"}

{"You can use the overlap prop to place the badge relative to the corner of the wrapped element."}

@@ -109,7 +133,13 @@ pub fn badge_page() -> Html { {circle} + + } +} +fn create_badge_alignment_view() -> Html { + html! { + <>

{"Badge alignment"}

{"You can use the anchorOrigin prop to move the badge to any corner of the wrapped element."}

@@ -130,6 +160,26 @@ pub fn badge_page() -> Html { + + } +} + +#[function_component(BadgePage)] +pub fn badge_page() -> Html { + // TODO(Shaohua): Add toggle visibility button + // TODO(Shaohua): Add anchor-origin check buttons + + html! { +
+

{"Badge"}

+ + {create_badge_basic_view()} + {create_color_view()} + {create_badge_visibility_view()} + {create_maximum_value_view()} + {create_dot_badge_view()} + {create_badge_overlap_view()} + {create_badge_alignment_view()}
}