Read page as text

NIB / DOCUMENTATION

Motion and reduced motion — NibComponents

Opt into component effects and account for the motion that lives outside that switch.

Open interactive view

Add motion after the interaction works

Most component constructors with an animated argument default it to false. Turning it on adds the documented NibMotion effect: a button press response, an input message transition, or an overlay entrance. The component still needs its ordinary callback and state when animation is disabled. Website playgrounds explicitly start their supported animations; that showcase configuration does not change the package constructor defaults.

A transition argument configures that component’s documented motion path. It is not a global speed control for every descendant. Import nib_motion explicitly when writing NibTransition; nib_components uses it as a dependency but does not re-export the entire motion API.

import 'package:flutter/material.dart';
import 'package:nib_components/nib_components.dart';
import 'package:nib_motion/nib_motion.dart';

NibButton(
  label: 'Try the press response',
  animated: true,
  transition: const NibTransition(duration: Duration(milliseconds: 160)),
  onPressed: () {},
)

Understand what animated does not switch off

animated: false is not a promise that the entire subtree is still. Flutter interaction feedback, gesture settling, loading indicators, and some layout transitions use other paths. These exceptions matter when choosing a reduced-motion policy.

Component or behaviorCurrent contract
NibFlipCardNo animated property. It always delegates face changes to NibFlip; duration defaults to 600 ms.
NibCircularLoaderNo animated property and no local reduced-motion check. Its AnimationController repeats while active.
NibTabsanimated controls the optional panel fade. Indicator glide, pager slide, and height reflow have separate gesture/layout behavior.
Bottom-sheet draggingSnap settling uses an internal AnimationController and spring; animated controls the optional entrance/exit path.
Duplicate toastThe default shake duplicate policy can move an existing toast even with animated: false. Choose ignore or replace when that motion is unwanted.

Flip cards

Loading indicators

Bottom-sheet snapping

Toast duplicate behavior

Respect the preference at the relevant layer

NibMotion and NibFlip use the motion package’s reduced-motion policy. With its default policy, the system MediaQuery.disableAnimations preference causes motion to settle at the target. The local candidate’s NibFlip also keeps only the actually visible face in focus traversal and semantics while a flip is running.

A loader is a separate case. Replace a decorative spinning loader with readable static status when reduced motion is requested. TickerMode can silence tickers in an inactive preview, but it does not label the work, cancel a request, or establish a reduced-motion policy for arbitrary timers. Do not rely on it as the only accessibility control.

Widget busyStatus(BuildContext context) {
  final reduce = MediaQuery.disableAnimationsOf(context);
  return Semantics(
    liveRegion: true,
    label: 'Saving changes',
    child: ExcludeSemantics(
      child: reduce
          ? const Text('Saving changes…')
          : const NibCircularLoader(size: 28),
    ),
  );
}

Test interruptions and the final state

Trigger a change, reverse it before it finishes, then enable reduced motion. The final selected value, visible message, and available action should still match application state. Test disabling an interactive surface during a held press, removing an open overlay, and leaving a screen with a loader active.

Use numeric state and semantics assertions where possible. A test that simply pumps without an exception does not prove a correct endpoint. Widget tests can check state and cleanup; physical-device frame pacing and GPU appearance require separate device evidence.

Accessible interaction checks

Liquid glass press and fallback behavior