NIB / DOCUMENTATION
Tabs — NibComponents
Switch panels while keeping the header, selected content, and footer in one vertical scroll.
Open interactive viewGive the tab set one bounded viewport
NibTabs owns one vertical CustomScrollView. Its header scrolls away, the bar pins, the active panel participates in that same vertical scroll, and the footer follows it. Put content above and below in the header and footer arguments.
The preview supplies a 290-pixel bounded height. In a full screen, Expanded can supply the remaining height. Do not wrap NibTabs in another vertical ListView or SingleChildScrollView: that recreates competing scroll ownership.
Select by tap, swipe, or controller
Tap Notes or press Animate to notes. NibTabsController.index reports the selection; animateTo asks for movement and jumpTo switches immediately. This demo uses an external controller for those two buttons and disposes it with the demo.
NibTab contains a label, optional icon, and lazy panel builder. initialIndex applies when no external controller supplies its own index. Keep tab identities and order meaningful when rebuilding; selecting index 1 only has meaning relative to the current list.
Tune the tab bar and panel separation
scrollable gives tabs their intrinsic widths in a horizontal bar; otherwise tabs share the available width. indicatorStyle chooses underline, pill, or none. panelGap separates outgoing and incoming panels and adds space before the footer.
swipeable controls horizontal page gestures; tapping the tab bar still works. The preview’s controls map to these actual properties. Test long labels, different panel heights, and a narrow width rather than assuming equal-sized sample text covers your content.
Distinguish fade from layout movement
animated opts into the new panel’s NibMotion fade. The indicator glide, pager slide, and height reflow use their own layout or gesture animation paths and can move when animated is false. transition configures programmatic and settle timing.
Use jumpTo when the host explicitly requests an immediate page switch. Review your full reduced-motion policy instead of presenting animated: false as a universal motion disable switch. Panel data and request cancellation remain owned by the host.