Zoom Addon

A utility addon designed for zooming in/out of the previewed story.

Usage

widgetbook/lib/widgetbook.config.dart
final config = Config(
  // ...
  addons: [
    ZoomAddon(), 
  ],
);

Order

Since the order of addons matters, here are some guidelines to follow when using the ZoomAddon:

Addons that should come before the ZoomAddon:

  • ViewportAddon
  • DeviceFrameAddon
  • AlignmentAddon

Mode

To use this addon for testing, you can enable the ZoomMode in your stories:

final $Default = _Story(
  scenarios: [
    _Scenario(
      name: '2x Zoom',
      modes: [
        ZoomMode(2), 
      ]
    ),
  ],
)