Skip to content
pubscout

widgetbook

3.25.0, released 5 months ago by widgetbook.io

A sandbox for building and testing Flutter widgets and screens in isolation.

WASM-readyRock solid
$ flutter pub add widgetbook
Source repository

What it does

Widgetbook lets you develop UI components and full screens without running the whole app. It lets you mock hard‑to‑reach states, catalog widgets, and run visual golden tests across devices and themes.

AI-written summary of version 3.25.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to design or iterate UI components quickly
  • You want visual regression (golden) testing for widgets
  • You want to share a UI library or component catalogue with designers or other developers

Skip it when

  • You only need runtime business logic or state‑management solutions
  • Your project is tiny and adding a full UI sandbox feels heavyweight

Strengths

  • Easy isolation of widgets for rapid UI development
  • Built‑in support for golden/visual regression tests
  • Cross‑platform preview and theming
  • Integrates with Widgetbook Cloud for sharing and CI

Weaknesses

  • Adds extra tooling and build steps to the project
  • Primarily focused on UI, not on state‑management or backend logic
  • May increase CI time due to visual test generation

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
9
import 'package:flutter/material.dart';
import 'package:widgetbook/widgetbook.dart';

void main() => runApp(const Widgetbook(
  categories: [],
  widgets: [
    WidgetbookComponent(name: 'Button', useCases: [
      WidgetbookUseCase(name: 'Default', builder: (_) => ElevatedButton(onPressed: () {}, child: Text('Press'))),
    ]),
  ],
));

Works with

Packages commonly used together with widgetbook: ones it builds on, ones built on it, and its own family.