diff --git a/crates/story/src/tabs_story.rs b/crates/story/src/tabs_story.rs index 420400b8..c6671b16 100644 --- a/crates/story/src/tabs_story.rs +++ b/crates/story/src/tabs_story.rs @@ -245,5 +245,20 @@ impl Render for TabsStory { .children(vec!["Appearance", "Settings", "About", "License"]), ), ) + + .child( + section("Segmented Tabs (With filling space)").max_w_md().child( + TabBar::new("flex tabs") + .w_full() + .segmented() + .with_size(self.size) + .selected_index(self.active_tab_ix) + .on_click(cx.listener(|this, ix: &usize, window, cx| { + this.set_active_tab(*ix, window, cx); + })) + .child(Tab::new().flex_1().label("About")) + .child(Tab::new().flex_1().label("Profile")) + ), + ) } } diff --git a/crates/ui/src/tab/tab.rs b/crates/ui/src/tab/tab.rs index c5eeb42c..a8ff3551 100644 --- a/crates/ui/src/tab/tab.rs +++ b/crates/ui/src/tab/tab.rs @@ -620,6 +620,7 @@ impl RenderOnce for Tab { .when_some(self.prefix, |this, prefix| this.child(prefix)) .child( h_flex() + .flex_1() .h(inner_height) .line_height(relative(1.)) .items_center()