Read page as text

NIB / DOCUMENTATION

Glass bottom navigation — NibComponents

Keep a floating glass bar above scrolling content while each destination retains its local state.

Open interactive view

Use the actual navigation API

This is an example composition built from NibMotion’s NibNavBar. The Components package exports NibLiquidGlass and NibNavigationMenu, but neither is a bottom navigation bar. The existing package glass showcase supplies the styling pattern; this example adds related destination content and retained draft state.

Both packages export a class called NibNavItem. Import nib_motion with a prefix, as the complete example does. A Motion item describes an icon, label and badge; a Components navigation-menu item describes a recursive menu tree.

Give the glass something to filter

Place the scrolling page and floating bar in the same Stack. The bar must paint after the content so its backdrop filter can sample that content. The list has bottom padding equal to the bar height plus spacing, which lets the last row scroll clear of the bar.

NibNavBarStyle.glass enables NibMotion’s NibGlass surface. glassTint, glassBlur and glassHighlight control that background. The pill selection indicator is a separate layer; changing the background blur does not change the pill’s spring.

The guide uses Ember tokens for foreground, inactive icons, border and tint. A local SafeArea protects the bottom edge. A production Scaffold still needs an explicit keyboard policy; this bounded example does not demonstrate a native keyboard or system gesture area.

Change the destination as well as the indicator

NibNavBar is controlled: currentIndex is the selected destination, and onIndexChanged reports activation. The host updates both currentIndex and an IndexedStack. An IndexedStack keeps each child mounted, so the Inbox draft remains when you visit Settings and return.

The “Next destination from host” button exercises external state changes through the same selection function. This example owns its TextEditingController and FocusNode, disposes both, and releases the draft field’s focus before changing destinations. Tuning radius, badge count or glass style leaves the draft intact.

Selection stays inside the example. Browser history is not changed, repeated activation can report the same index, and there is no automatic back-stack policy. An application can instead use NibScaffold and NibScreenStack for the library’s screen-transition and keepAlive options.

Configure labels, icons and badges

Every NibNavItem requires icon. activeIcon falls back to icon; label is optional. tooltip supplies the accessible target label in this implementation. Keep the item count and currentIndex valid when changing the list.

NibNavBadge.count null means a dot, zero means hidden, and positive counts cap the displayed text at 99+. The example lets you change a numeric count and uses explicit Ember foreground/background colors. Badge copyWith uses null as “keep the old value,” so construct a new badge to switch an existing numeric badge to a dot.

The painter bounds labels to one line with ellipsis. It does not automatically read the ambient TextScaler; this host applies that scale to labelStyle.fontSize and enlarges the bar height. Test very long translations with the number of tabs you actually ship.

Know when selection occurs

Each native target is focusable and exposes selected/button semantics. Tab reaches destinations; Enter and Space activate the focused destination. The package does not provide arrow-key roving between these tabs, and this example does not claim that convention.

Pointer selection is reported on tap-down. Cancellation releases the pressed pose but does not roll back a destination already selected on pointer-down. A horizontal drag is not a supported tab-scrubbing API. The guide tests that cancellation leaves a coherent selected screen rather than inventing a drag gesture.

Reduced motion settles the spring and liquid phase. Physical touch, screen-reader announcements and GPU rendering still require device checks; widget semantics and deterministic input tests establish a narrower contract.

Diagnose the common integration mistakes

If the indicator moves but content does not change, wire onIndexChanged to your own screen state. If a draft disappears, check whether the selected body replaces the entire screen instead of retaining it. Do not create a new controller inside build.

A bar needs a finite width. Put it inside a bounded Stack, Scaffold slot or constrained container; do not place it directly in an unconstrained horizontal Row. Leave enough bottom content padding so the last row remains reachable.

For flat-looking glass, put structured content behind it and check renderer support. For a liquid indicator that looks different on another backend, distinguish the shader path from the painted lens fallback. The guide does not infer backend identity from the selected effect name.

Limits and platform evidence

Composition using nib_motion 0.3.4 and nib_components 0.2.2 local candidates. It is not an additional public Components widget.

Physical Android/iOS touch, native safe areas, screen readers and GPU paths are not certified by the bounded Flutter preview.

Pointer-down commits selection; cancelling a pointer does not restore the previous destination. Drag-to-select is not implemented.