Read page as text

NIB / PLAYGROUND

Switch playground — NibComponents

Try switch in Flutter. Change a setting and show when confirmation is pending.

Open interactive view

Change a setting and show when confirmation is pending.

Read the full component guide and API

Public widgets and APIs

  • NibSwitch
  • NibSwitchThumbBuilder
  • NibSwitchThumbState

Example Dart code

NibSwitch(value: enabled, label: 'Workspace updates', animated: true,
  transition: const NibTransition(
    duration: Duration(milliseconds: 320), curve: Curves.easeInOutCubic,
  ),
  onChanged: (next) => setState(() => enabled = next),
)

Playground controls

ControlTypeOptions or rangeHelp
Animate feedbacktoggle
Disabledtoggle
Labeltext
Off / onnumber0.0–1.0
Loadingtoggle
Thumbchoicedefault, icons, images, custom, image-thumb