fossui library
fossui: an open-source Flutter UI library.
A single import for the theme system and widgets. Native Flutter theming, golden-tested components.
Classes
- FossAlert Feedback
-
- FossAlertDialog
-
- FossAlertDialogStyle
-
Visual overrides for a single FossAlertDialog. An alert style is a
FossDialogStyle: it carries the same fields and the alert composes a
FossDialog, so it passes its style straight through. Every field is
optional; a null field falls back to the value the theme resolves. Pass one
via
style:to tweak a one-off without changing the theme. - FossAlertStyle
-
Visual overrides for a single FossAlert. Every field is optional; a null
field falls back to the value the variant and theme resolve. Pass one via
style:to tweak a one-off without changing the theme. - FossAutocomplete Inputs
-
- FossAvatar Layout
-
- FossAvatarStyle
-
Visual overrides for a single FossAvatar. Every field is optional; a null
field falls back to the value the theme resolves. Pass one via
style:to tweak a one-off without changing the theme for every other avatar. - FossBadge Feedback
-
- FossBadgeStyle
-
Visual overrides for a single FossBadge. Every field is optional; a null
field falls back to the value the variant and theme resolve. Pass one via
style:to tweak a one-off without changing the theme. - FossButton Inputs
-
- FossButtonController
-
Drives a FossButton imperatively, so loading and disabled can be toggled
without rebuilding the button from new parameters. Pass one to a button's
controller; you own it and must dispose it. - FossButtonStyle
-
Visual overrides for a FossButton. Every field is optional; a null field
falls back to the value the theme resolves for the button's variant and
size. Pass one to a single button via
style:to tweak a one-off, without changing the theme for every other button. - FossCard Layout
-
- FossCardStyle
-
Visual overrides for a single FossCard. Every field is optional; a null
field falls back to the value the theme resolves. Pass one via
style:to tweak a one-off without changing the theme for every other card. - FossCheckbox Inputs
-
-
FossCheckboxGroup<
T> Inputs - Lays out a set of FossCheckboxItem options as a multi-select group.
-
FossCheckboxItem<
T> - A single option within a FossCheckboxGroup.
- FossCheckboxStyle
-
Visual overrides for a single checkbox. Every field is optional; a null
field falls back to the value the theme resolves. Pass one via
style:to tweak a one-off without changing the theme for every other checkbox. - FossColors
- Semantic color roles, one field per role. light and dark are baked constant sets; every blend and translucent overlay is resolved to a fixed sRGB color, so no color math runs at runtime.
-
FossCombobox<
T> Inputs -
-
FossComboboxItem<
T> - One option in a FossCombobox.
- FossComboboxStyle
- Visual overrides for a FossAutocomplete or FossCombobox. Every field is optional; a null field falls back to the theme-resolved value.
- FossDialog
-
- FossDialogStyle
-
Visual overrides for a single FossDialog. Every field is optional; a null
field falls back to the value the theme resolves. Pass one via
style:to tweak a one-off without changing the theme for every other dialog. - FossDrawer
-
- FossDrawerStyle
-
Visual overrides for a single FossDrawer. Every field is optional; a null
field falls back to the value the theme resolves. Pass one via
style:to tweak a one-off without changing the theme for every other drawer. - FossMotion
-
Animation durations. Gate any token-driven animation on
MediaQuery.disableAnimationsso reduced-motion users get no motion. -
FossMultiCombobox<
T> Inputs -
-
FossMultiSelect<
T> Inputs - A pick-several-from-list control with no typing.
- FossProgress Feedback
-
- FossProgressStyle
-
Visual overrides for a single FossProgress. Every field is optional; a
null field falls back to the value the theme resolves. Pass one via
style:to tweak a one-off without changing the theme for every other bar. - FossRadii
- Corner radii in logical pixels. standard is the default scale; full is a pill sentinel, clamped to half the height at the use site.
-
FossRadio<
T> Inputs -
-
FossRadioGroup<
T> Inputs - Lays out a set of FossRadio options as a single-choice group.
- FossRadioStyle
-
Visual overrides for a single FossRadio. Every field is optional; a null
field falls back to the value the theme resolves. Pass one via
style:to tweak a one-off without changing the theme for every other radio. -
FossSelect<
T> Inputs -
-
FossSelectItem<
T> - One option in a FossSelect or FossMultiSelect.
- FossSelectStyle
-
Visual overrides for a single FossSelect or FossMultiSelect. Every field
is optional; a null field falls back to the value the theme resolves. Pass
one via
style:to tweak a one-off without changing the theme for every other select. - FossSeparator Layout
-
- FossShadows
-
Layered drop shadows per elevation step. Each is a baked
List<BoxShadow>(black at low alpha); none is an empty list. Resolved at author time, no shadow math at runtime. - FossSince
- Records the fossui version a public API was introduced in.
- FossSlider Inputs
-
- FossSliderStyle
-
Visual overrides for a single FossSlider. Every field is optional; a null
field falls back to the value the theme resolves. Pass one via
style:to tweak a one-off without changing the theme for every other slider. - FossSpacing
-
Spacing scale built from one unit (4 px). Call the instance to scale the
unit (call) or build an inset (all); every step is
unit * n. - FossSpinner Feedback
-
- FossSwitch Inputs
-
- FossSwitchStyle
-
Visual overrides for a single switch. Every field is optional; a null field
falls back to the value the theme resolves. Pass one via
style:to tweak a one-off without changing the theme for every other switch. -
FossTab<
T> - One tab: its value, label, optional leading icon and content panel, and whether it is enabled.
-
FossTabs<
T> Layout -
- FossTabsStyle
-
Visual overrides for a single FossTabs. Every field is optional; a null
field falls back to the value the theme resolves for the chosen variant.
Pass one via
style:to tweak a one-off without changing the theme for every other tab set. - FossTextField Inputs
-
- FossTextFieldStyle
-
Visual overrides for a FossTextField. Every field is optional; a null
field falls back to the value the theme resolves for the size and state.
Pass one to a single field via
style:to tweak a one-off, without changing the theme for every other field. - FossTheme
-
Provides a FossThemeData to its subtree for non-Material apps. Material
apps can instead register the theme in
ThemeData.extensions; either waycontext.fossThemeresolves it. - FossThemeData
-
The root token bundle: the six leaf bundles in one object. Register it once,
then read everything through
context.fossTheme. FossThemeData.light and FossThemeData.dark are the defaults; build your own to retheme the app. - FossThemeSpec
- A compact override layer for retheming a FossThemeData in one call.
- FossToast
-
- FossToastController
-
Owns the queue of live toasts and their auto-dismiss timers. Shared by a
FossToasterand read withFossToastScope.of. Notifies on every change. - FossToastEntry
- A live toast in a FossToastController's queue.
- FossToaster
- Hosts transient toasts over its child. Mount it once near the app root, above everything that needs to raise a toast.
- FossToastHandle
- A handle to a raised toast, returned by showFossToast. Holds the toast's id and its toaster so the caller can dismiss it early or update its message without threading a BuildContext back in.
- FossToastScope
- Shares a FossToastController with the subtree. Read it with FossToastScope.of; provided by a FossToaster.
- FossToastStyle
- Visual overrides for a single FossToast. Every field is optional; a null field falls back to the value the theme resolves.
- FossTooltip
-
- FossTooltipStyle
-
Visual overrides for a single FossTooltip. Every field is optional; a null
field falls back to the value the theme resolves. Pass one via
style:to tweak a one-off without changing the theme for every other tooltip. - FossTypography
-
Text styles per size step. Each carries family, size, line height, and
letter spacing; set weight with the FossTextStyleWeight getters (
.mediumfor labels and buttons,.semiboldfor headings,.boldfor emphasis).
Enums
- FossAlertVariant
- The status of a FossAlert, driving its border, fill, and leading glyph.
- FossAvatarSize
- The size axis of a FossAvatar. Selects the square box edge and the fallback text step; md (32) is the default.
- FossBadgeSize
- The size axis of a FossBadge: the pill height, minimum width, horizontal padding, and type step. md is the default.
- FossBadgeVariant
- The color axis of a FossBadge. primary is the default solid pill; secondary, outline, and destructive complete the solid set; info, success, warning, and error are soft, tinting the role at low alpha.
- FossButtonSize
- The size of a FossButton.
- FossButtonStatus
- The interactive status a FossButtonController holds. The three states are mutually exclusive: idle is the normal, enabled state.
- FossButtonVariant
- The visual treatment of a FossButton.
- FossCheckboxGroupVariant
- The visual treatment of a FossCheckboxGroup.
- The footer treatment shared by the dialog and the alert dialog.
- FossDialogPresentation
- How a modal presents: a centered card or a bottom-stuck sheet.
- The footer treatment of a FossDrawer.
- FossDrawerSide
- The edge a FossDrawer anchors to and slides in from.
- FossDrawerVariant
- The corner treatment of a FossDrawer surface.
- FossRadioGroupVariant
- The visual treatment of a FossRadioGroup.
- FossSelectSize
- The height and type scale of a FossSelect or FossMultiSelect trigger.
- FossSeparatorOrientation
- The axis a FossSeparator runs along.
- FossTabsOrientation
- The axis the tab strip runs along.
- FossTabsVariant
- The two tab looks.
- FossTextFieldSize
- The size of a FossTextField.
- FossToastVariant
- The kind of a FossToast: drives the leading glyph, its tint, and whether the toast auto-dismisses.
- FossTooltipSide
- The side of the anchor a FossTooltip prefers to open on. The popup flips to the opposite side when it would overflow the viewport.
Extensions
- FossTextStyleWeight on TextStyle
- Weight conveniences on a TextStyle, for use on the FossTypography scale.
- FossThemeContext on BuildContext
- The single way to read fossui tokens.
Functions
-
fieldMetrics(
FossThemeData theme, FossTextFieldSize size) → ({Color fill, double minHeight, double padX, double radius}) -
The size-driven field geometry: resting fill, corner radius, minimum height,
and horizontal inset. Shared so every field surface (single-line input,
chips input) resolves the same box from the same
size. -
showFossAlertDialog<
T> ({required BuildContext context, required WidgetBuilder builder, FossDialogPresentation presentation = FossDialogPresentation.bottomSheet, String? barrierLabel, }) → Future< T?> -
Opens a non-dismissible alert dialog and resolves to the value passed to
Navigator.pop. -
showFossDialog<
T> ({required BuildContext context, required WidgetBuilder builder, FossDialogPresentation presentation = FossDialogPresentation.bottomSheet, bool barrierDismissible = true, String? barrierLabel, }) → Future< T?> -
Opens a modal dialog and resolves to the value passed to
Navigator.pop. -
showFossDrawer<
T> ({required BuildContext context, required WidgetBuilder builder, FossDrawerSide side = FossDrawerSide.bottom, bool barrierDismissible = true, String? barrierLabel, }) → Future< T?> -
Opens an edge FossDrawer and resolves to the value passed to
Navigator.pop. -
showFossToast(
BuildContext context, FossToast toast) → FossToastHandle -
Raises
toaston the nearest FossToaster and returns a FossToastHandle to dismiss or update it.