FAQ

Is Widgetbook free?

Yes. Widgetbook is open source and free. Widgetbook Cloud is a separate, optional product for hosted builds and visual reviews.

Do I need a separate package for Widgetbook?

Yes. Widgetbook lives in its own package that depends on your app or design system. widgetbook init sets it up. To catalog several packages from one Widgetbook, see Widgetbook in a Monorepo.

What is the difference between an Arg and a Mode?

Args control the widget's properties: text, color, state. They come from the widget's constructor.

Modes control the environment: theme, locale, viewport, text scale. They come from Addons.

See Core Concepts.

_Story and _Args are undefined

Both are generated. Check the stories file has a part directive and a Meta declaration, then run the generator.

dart
widgetbook/lib/button.stories.dart
part 'button.stories.g.dart';

const meta = Meta(Button.new);
bash
dart run build_runner build

Use dart run build_runner watch during development. See Code Generation.

Why does a bare _Story() not compile?

Constructor parameters without a usable default must be passed through args. A required onPressed has no default, so the story needs onPressed: Arg.fixed(() {}).

Widgets whose parameters are all optional or defaulted work with _Story(). See Quick Start.

How do I catalog a screen that fetches data?

Mock the dependency and inject it with the story's setup hook: a ProviderScope, a BlocProvider, a stubbed repository. See Mocking.

Do I have to write visual tests?

No. Write Scenarios. flutter test captures a screenshot of each one. With Widgetbook Cloud those snapshots are diffed on every pull request. See What are Visual Tests?.

Where do snapshots go?

build/.widgetbook in your Widgetbook package. See Run Scenarios.

Does Widgetbook work with Cupertino or a custom design system?

Yes.

App typeAddon
MaterialAppMaterialThemeAddon
CupertinoAppCupertinoThemeAddon
Custom themeThemeAddon

See Theme Addon.

Does Widgetbook collect data?

It reports anonymous usage data after build_runner build, and no personal data. Telemetry lists what is sent and how to opt out.

How do I upgrade from v3?

See the v4 Migration Guide. It recommends writing a few v4 stories by hand first, then using an agent primed with your conventions. A manual workflow is at the end of the page.

Where do I get help?

Discord, or Resources for talks, articles, and example projects.