NIB / DOCUMENTATION
Component catalog — NibComponents
Find every exported widget family by the task it handles.
Open interactive viewChoose widgets around a concrete task
Start with the interaction you need to complete. A profile editor might use NibCard to group fields, NibInput for a name, NibTextarea for a biography and NibButton to save. A NibSwitch is suitable for an immediately applied setting; a NibCheckbox suits a choice that belongs to a later submission. The host decides whether changing the setting saves immediately or waits for the form.
For a short visible set, NibRadioGroup communicates one choice and NibToggleGroup suits toolbar-like options. NibSelect puts a known list behind a trigger. NibCombobox adds a text field for filtering; allowFreeText is false by default, so typing an unmatched query does not create a new option. Turn it on only when your domain accepts new free text, and handle onFreeTextSubmitted separately from selecting an existing value.
NibDatePicker handles calendar selection, while NibOtpInput collects a structured code. A number-looking field is not interchangeable with either: dates need range and locale decisions, and code entry needs completion handling. Choose the value model first, then pick the control that exposes that model. Keep labels in the user’s vocabulary rather than exposing your enum names.
Forms and input
Start with NibInput or NibTextarea for text that belongs to a Flutter Form. Use NibSelect for a known list, NibCombobox when users may filter or search, and NibDatePicker for calendar selection.
The remaining input controls cover boolean, range, and structured entry. Their value and callback contracts differ; check each constructor rather than assuming one generic form API.
| API | Type | Default | Behavior |
|---|---|---|---|
| NibButton | Widget | — | Action control with variants, sizes, loading, and disabled states. |
| NibInput / NibTextarea | FormField<String> | — | Single-line and multiline text with Flutter Form validation. |
| NibCheckbox / NibSwitch | Widget | — | Controlled boolean input; checkbox also supports tristate. |
| NibRadioGroup / NibToggleGroup | Widget | — | Choose from a small visible set. |
| NibSlider | Widget | — | Single or range numeric input. |
| NibSelect / NibCombobox | Widget | — | Select from a list; combobox can load options asynchronously. |
| NibOtpInput / NibDatePicker | Widget | — | Segmented code entry and calendar selection. |
Compose a card and expandable details
Paste this subtree into a Scaffold body after importing nib_components. NibCard has header, child and footer slots. Its default is plain content; interactive: true opts the whole card into tapping, and onTap supplies the action. Do not turn a card into a large invisible button when its only action is already a clearly labeled button inside it.
NibAccordion owns expansion state unless you provide a controller. With allowMultipleOpen false, opening one item closes the previous item. Add a second item, open both in turn, then enable allowMultipleOpen to compare the behavior. Its expansion callback reports the tapped index and new open state. That is useful for analytics or coordinating another panel; it is not needed merely to make the accordion expand.
NibCard(
header: const Text('Delivery details'),
child: NibAccordion(
items: const [
NibAccordionItem(
title: Text('When will it arrive?'),
content: Text('Your confirmation includes the estimated date.'),
),
NibAccordionItem(
title: Text('Can I change the address?'),
content: Text('Contact support before the order is dispatched.'),
),
],
),
)Overlays and popups
Overlays need a trigger or a host-owned controller. Close them from a deliberate result or cancellation path, and keep the calling widget mounted until an awaited result is handled.
The package exports placed widgets and top-level show functions for several overlays. Those are different entry points to the same interaction family.
| API | Type | Default | Behavior |
|---|---|---|---|
| NibDialog / showNibDialog | Widget / function | — | Modal content and optional typed close result. |
| showNibAlertDialog | function | — | Confirm or alert popup with severity and actions. |
| NibBottomSheet / showNibBottomSheet | Widget / function | — | Sheet interaction with declarative or imperative opening. |
| NibPopover / NibHoverCard | Widget | — | Anchored information and pointer-oriented hover content. |
| NibContextMenu / showNibContextMenu | Widget / function | — | Contextual menu entries. |
| NibCommandPalette | Widget | — | Keyboard-searchable command launcher. |
| showNibToast | function | — | Transient status message. |
Choose how much attention an action needs
Use a dialog for a decision that interrupts the current task, a bottom sheet for a focused mobile interaction, and a popover for content anchored to a trigger. A hover card adds pointer detail, but essential instructions still need a touch and keyboard route. A context menu groups actions for an item; a command palette searches across host-registered commands. None of these decides your app’s permissions or routing.
For feedback, a toast communicates a short outcome, a loader communicates ongoing work, and NibSkeleton shades the real content tree while loading. Skeleton children still exist, so they must be safe to build before data arrives. NibSkeletonBone and NibSkeletonIgnore refine detection without maintaining a second copy of the layout. NibFlipCard, NibCarousel and NibLiquidGlass provide more specialized presentation; introduce them after the content and navigation remain usable without their visual effects.
The button demo below is a focused interaction sample, not a renderer for every catalog family. Use its Add one and Reset controls to practice host state, then apply that pattern to the family you chose. Tables, tabs and resizable panels have additional layout and controller contracts covered in the API guide.
Layout, data, and feedback
NibDataTable is the data-heavy control; pass columns and rows, then choose local or host sorting. NibTabs and NibResizablePanels need a bounded layout, so test them at the widths your app supports.
| API | Type | Default | Behavior |
|---|---|---|---|
| NibCard / NibFlipCard | Widget | — | Content container and two-sided card. |
| NibDataTable | Widget | — | Sortable and selectable rows. |
| NibAccordion / NibCarousel | Widget | — | Expandable groups and horizontal content sequence. |
| NibResizablePanels | Widget | — | User-adjustable panel sizes. |
| NibSkeleton / NibCircularLoader | Widget | — | Loading placeholders and progress indicator. |
| NibLiquidGlass | Widget | — | Visual surface effect. |
| NibTheme / NibValidators | ThemeExtension / helpers | — | Design tokens and text validation helpers. |