Skip to content

Commit

Permalink
Update nav rail
Browse files Browse the repository at this point in the history
  • Loading branch information
matthunz committed Oct 22, 2023
1 parent 01f5745 commit 4751520
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions examples/navigation_rail.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
use dioxus::prelude::*;
use dioxus_material::{NavigationRail, NavigationRailItem, Theme};
use dioxus_material::{NavigationRail, NavigationRailItem, Theme, Icon, IconKind, IconFont};

fn app(cx: Scope) -> Element {
render!(
IconFont {}
Theme {
NavigationRail {
NavigationRailItem {
icon: render!("A"),
icon: render!(Icon { kind : IconKind::Home }),
label: render!("All files"),
is_selected: false,
onselect: |_| {}
}
NavigationRailItem { icon: render!("B"), label: render!("Recent"), is_selected: true, onselect: |_| {} }
NavigationRailItem {
icon: render!("C"),
icon: render!(Icon { kind : IconKind::History }),
label: render!("Recent"),
is_selected: true,
onselect: |_| {}
}
NavigationRailItem {
icon: render!(Icon { kind : IconKind::PhotoAlbum }),
label: render!("Photos"),
is_selected: false,
onselect: |_| {}
Expand Down
2 changes: 1 addition & 1 deletion src/navigation_rail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn NavigationRail<'a>(cx: Scope<'a>, children: Element<'a>) -> Element<'a> {
width: "50px",
list_style: "none",
margin: 0,
padding: 0,
padding: "0 10px",
children
}
}
Expand Down

0 comments on commit 4751520

Please sign in to comment.