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
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.
- url_launcherwidgetbook depends on itFlutter plugin for launching URLs across mobile, desktop, and web platforms.
- nestedwidgetbook depends on itWidget that flattens deeply nested widget trees into a list of children.
- resizable_widgetwidgetbook depends on itWidget that enables users to resize internal child widgets by dragging separators.
- accessibility_toolswidgetbook depends on itCheckers and tools to verify accessibility and test app behavior during development.
- inspectorwidgetbook depends on itA Flutter package for inspecting widgets, colors, and sizes during debugging and QA testing.
- widgetbook_annotationwidgetbook depends on itAnnotations for widgetbook_generator to build Flutter widgets in isolation.
- device_frame_pluswidgetbook depends on itMockups and frames for common devices to preview and test Flutter apps.
- widgetbook_generatorSame familyGenerates and sets up Widgetbook code via build_runner