Tabs
PaymentTabs switches between views of the same content: filters of a list, or “Card” and “Bank transfer” details. TransactionHistory uses it for its filters.





PaymentTabs( fitted: true, tabs: const [ PaymentTab(label: 'Card'), PaymentTab(label: 'Bank transfer'), PaymentTab(label: 'Wallet'), ], selectedIndex: 0, onSelected: (_) {}, );Variants
Section titled “Variants”Variants: small, medium, large; fitted or intrinsic.
Selected
Section titled “Selected”The selected tab changes to the accent color and gains a 2 px underline. The weight stays the same so labels do not shift when chosen, and screen readers hear it as selected.
Many or long labels
Section titled “Many or long labels”The row scrolls sideways instead of wrapping, so long or enlarged labels never stack into a block. The row sits on a 1 px outline hairline.
Behavior, states and migration
Section titled “Behavior, states and migration”PaymentTabs holds the PaymentTabs and PaymentTabPanels the panels; selectedIndex and onSelected control selection. Sizes are small (caption, 8 dp sides), medium (label, 12 dp), and large (heading, 16 dp); every target stays at least 48 dp. Fitted divides the available width equally. Arrow keys move focus without selection and skip disabled tabs; Enter or Space selects. A disabledReason is spoken as a hint and shown in a tooltip; explain unavailability in visible content too.
Panels build on first selection and keep state. Offstage, TickerMode and ExcludeFocus hide inactive panels and pause their tickers. Do not put a requirement exclusively in a hidden panel.
Breaking migration: replace labels with tabs, wrapping each string in PaymentTab(label: …).
Fitted tabs use equal widths only when every label fits at the current text scale. Otherwise they scroll horizontally, preserving whole words.
Which variant when
Section titled “Which variant when”| Situation | Variant / composition | Payment example |
|---|---|---|
| Transaction status filters | intrinsic | Use views of the same records; disabled tabs need a reason. |
Use List for navigation to separate account destinations.
States
Section titled “States”The host supplies the selected tab. Disabled tabs stay visible but cannot be selected.
Layout. When the tabs do not fit, the row scrolls and fades at the edge that has more tabs. Selecting or focusing a tab scrolls the row so that tab is fully visible; only the tab row moves, never the page. Under reduced motion the row jumps instead of animating.
Do and don’t
Section titled “Do and don’t”Do: Use views of the same records; disabled tabs need a reason.
Don’t: Use tabs as a sequence of required KYC tasks.
Content guidelines
Section titled “Content guidelines”- Use short nouns, one or two words each: “All”, “Pending”, “Refunds”.
- Use sentence case and no end punctuation.
- Use tabs for views of the same content. To move between screens use the navigation shell; to make a choice that is saved, use radios.
Accessibility
Section titled “Accessibility”- Each tab is a button at least 48 × 48 dp, marked selected or not.
- Tabs press to 0.96 like other compact controls, and keyboard focus draws the kit’s focus ring; the row clips only at its sides so the ring stays visible.
In the example app
Section titled “In the example app”

PaymentTabs
class PaymentTabs extends StatefulWidget · lib/src/controls/controls.dart
Controlled tabs. Arrows move focus, skipping disabled tabs; Enter or Space selects. Sizes change typography and padding, never the 48 dp target.
| Parameter | Type | Default | Description |
|---|---|---|---|
tabs:required | List<PaymentTab> | — | Tabs in reading order. |
selectedIndex:required | int | — | Host-owned active tab index. |
onSelected:required | ValueChanged<int> | — | Reports manual tab activation. |
size: | PaymentSize | PaymentSize.medium | Typography and padding size. |
fitted: | bool | false | Divide available width equally when every label fits; otherwise scroll. |
PaymentTab
class PaymentTab · lib/src/controls/controls.dart
A tab label and optional unavailability reason.
| Parameter | Type | Default | Description |
|---|---|---|---|
label:required | String | — | Visible tab label. |
disabledReason: | String? | — | Explanation for an unavailable tab. |
PaymentTabPanels
class PaymentTabPanels extends StatefulWidget · lib/src/controls/controls.dart
Lazily builds selected panels and preserves visited state. Hidden panels are offstage, excluded from focus and semantics, and have paused tickers.
| Parameter | Type | Default | Description |
|---|---|---|---|
selectedIndex:required | int | — | — |
children:required | List<Widget> | — | — |
PaymentSize
enum PaymentSize · lib/src/foundation/payment_tokens.dart
Visual size only; layout box and hit area stay at least 48×48 dp. Components document their heights.
| Value | Description |
|---|---|
small | Module headers, table or chip rows; never the main action. |
medium | Default, today's visual size. |
large | One primary action on a full-screen wide view. |
See also
Section titled “See also”- Transaction history, which uses these tabs for its filters.
- Radio for a choice that is submitted with a form.