Read page as text

NIB / DOCUMENTATION

Accessible component composition — NibComponents

Name controls, preserve keyboard paths, and verify the final screen at useful text sizes.

Open interactive view

Name the action, then expose its state

Prefer a visible label that describes the action. An icon-only NibButton needs semanticLabel, such as Add note. The button constructor requires a label, content, or semanticLabel; a custom content widget still needs a meaningful accessible name. When semanticLabel is supplied, the button replaces its descendant semantics with that name, so include all information needed to identify the action.

NibCheckbox and NibSwitch can use their visible label as the semantic name, with semanticLabel as an override. NibRadioGroup has a group label and option labels. NibSelect uses its semanticLabel or placeholder. Choose labels that distinguish neighboring controls instead of announcing several identical Select buttons.

Button content and semantic labels

Selection controls

Select labels and options

NibButton(
  semanticLabel: 'Add note',
  leadingIcon: const Icon(Icons.add),
  onPressed: () {},
)

Walk the screen with the keyboard

Start before the component and move through it using Tab and Shift+Tab. Activate buttons with Enter or Space. In NibRadioGroup, one option is the tab stop; arrow keys move and select among enabled options. Test custom optionBuilder content with that same path, because custom visuals do not replace the group’s keyboard contract.

Keep a visible focus ring after changing theme tokens. When you supply a FocusNode, retain it in State and dispose it yourself. Avoid setting autofocus on many competing controls. For a dialog, verify that focus enters the dialog, remains on available actions, and returns to its trigger when it closes.

Radio group keyboard navigation

Overlay focus and dismissal

Navigation menu interaction

Test the hit target and the actual text

A control’s visible height and interactive target are not always the same. NibButton has a package minimum tap-target mechanism around smaller visual sizes. Check the painted control and its surrounding hit region in the layout you ship, especially after adding clipping, transforms, or tightly constrained rows.

Use realistic long labels and increased text scaling at narrow widths. Prefer wrapping action rows or vertical stacking when space is limited. Do not use a FittedBox to shrink essential text merely to avoid overflow. Include error messages, loading text, translated labels, and selected values in the review.

Readability also depends on the backdrop. Glass content needs sufficient contrast over the backgrounds it can actually cover. Decorative grids and illustrations should not add unrelated semantic nodes. Essential instructions must remain readable when decorative motion or shader effects are unavailable.

Theme tokens and contrast states

Glass content and rendering fallback

Make errors and busy states understandable

Keep field labels visible while an error is shown. A validator should say what to fix, and a submission status should say what happened. Color alone is insufficient. NibInput and NibTextarea display error or helper text; your host decides whether to focus the first invalid field and where a summary belongs.

A custom-painted NibCircularLoader does not provide a task name on its own. Add a semantic status such as Saving changes, and provide readable static feedback under reduced motion. Avoid announcing every animation frame or repeated polling update as a live region. Announce a meaningful status change.

NibFlipCard accepts frontSemanticLabel and backSemanticLabel for tappable faces. Its visibility and focus behavior also depends on the resolved NibFlip implementation. The current local motion candidate gates focus and semantics by the actually visible face; do not infer that every older hosted dependency has that repair.

Validation and error precedence

Motion exceptions and static busy feedback

Separate widget checks from assistive-technology runs

Widget tests can inspect semantic names, roles, checked state, keyboard callbacks, focus, and layout bounds. Use them to catch regressions in your composition. Test disabled and loading states too, so an unavailable action is not still exposed as actionable.

A passing semantics test is not a screen-reader or physical touch pass. Run the finished screen with the assistive technologies and devices you support, record the package revisions and environment, and check reading order, announcements, focus restoration, and touch targets. The website preview does not certify those external checks.