Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Capture mode tabs

Linear: AUT-126

Three tabs at the top of the tray record popover: Screen / Window / Area. The first visible control on the record-from-tray path — it determines which setup UI is showing.

API

#![allow(unused)]
fn main() {
use ui_storybook::components::CaptureModeTabs;
use ui_storybook::fixtures::recorder::CaptureMode;

view! {
    <CaptureModeTabs
        selected=CaptureMode::Screen
        // optional — gray out modes the user can't enter:
        disabled_modes=vec![CaptureMode::Area]
    />
}
}

Composition

flowchart LR
    Tabs[CaptureModeTabs] -->|maps CaptureMode →| Segments[Segment × 3]
    Tabs --> SC[SegmentedControl]
    SC --> Segments

CaptureModeTabs is a thin wrapper that maps the three CaptureMode enum values to Segments and forwards them to SegmentedControl. The component itself owns no state; selected is a prop.

Disabled is a list, not a per-mode flag

disabled_modes is Vec<CaptureMode> so the parent can express "Area is currently blocked by permissions" without inventing a new Area::Disabled variant. Empty vec = all enabled.