Introduction

Guides

Security

Snapshots

Snapshots is the billing unit of the builds in Widgetbook Cloud. A snapshot is a addon configuration and knob configuration for a use-case inside a build. For example:

  • A Button use-case can have a "dark" and a "light" configuration when using the Theme addon.
  • A Button use-case can have a "long text" and "short text" configuration when using the string knob.

In short, the snapshots is a matrix between addons configs and knobs configs for each use-case in a build.

Dark x Short Text
Light x Short Text
Dark x Long Text
Light x Long Text

Default Configuration

When you create a build, Widgetbook Cloud will automatically create a default configuration for each use-case. This configuration is the one that is shown when the use-case is first opened in Widgetbook. If you want to add more configurations, you can do so by using the Multi Snapshot feature.

How are snapshots counted?

To estimate your snapshots count per build, you can use the following formula:

Snapshots = Knobs configs * Addons configs

For example, if your build has:

  • 3 use-cases:

    1. Button - 2 knobs configs (short text and long text)
    2. Card - 0 knob config (default configuration is counted as 1)
    3. Avatar - 1 knob config (no image)
  • 2 addons configs:

    1. Dark German - Dark theme with German Locale
    2. Light English - Light theme with English Locale

This means that the number of snapshots per build will be as follows:

Knobs configs = 2 (Button) + 1 (Card) + 1 (Avatar) = 4
Addons configs = 2 (Dark German and Light English)
Snapshots = 4 * 2 = 8

Exclude Use-cases

If you have some use-cases that you don't want Widgetbook Cloud to process the snapshots for, you can exclude them as follows:

@UseCase(
  name: 'Default',
  type: UnstableWidget,
  cloudExclude: true
)
Widget buildUseCase(BuildContext context) { ... }