Knobs
Knobs can be used to dynamically change the parameters passed to a usecase.
Usage#
Use context.knobs
to access the knobs builder and add knobs to your Widget
:
WidgetbookUseCase(
name: 'elevated',
builder: (context) => MyHomePage(
title: context.knobs.text(
label: 'Title Label',
initialValue: 'HomePage',
),
)
)
Properties#
All Knob
s have the following inherited properties to customize how the knobs are displayed in the UI of Widgetbook
:
Property | Type | Description |
---|---|---|
label | String | Labels the knob by giving it a title. The label must be unique for the WidgetbookUseCase . |
description | String? | A text which describes what the knob does. This can be used as a documentation within Widgetbook and helps your team member understand how to operate the knob. |