Switch – Forui (original) (raw)
A toggle switch component that allows users to enable or disable a setting with a sliding motion.
Preview
CLI
To generate and customize this style:
dart run forui style create switch
Usage
FSwitch(...)
FSwitch(
style: FSwitchStyle(...),
label: const Text('Airplane Mode'),
description: const Text('Turn on airplane mode to disable all wireless connections.'),
error: const Text('Please turn on airplane mode.'),
semanticsLabel: 'Airplane Mode',
value: true,
onChange: (value) {},
enabled: true,
autofocus: true,
);
Examples
Disabled
Preview
Form
Preview
Last updated on
May 25, 2025