Skip to main content

una 0.1.1 copy "una: ^0.1.1" to clipboard
una: ^0.1.1 copied to clipboard

A themeable Flutter design system: 100+ widgets, frosted-glass surfaces, desktop and phone metrics in one theme, Liquid Glass on iOS and macOS, and no Material dependency.

0.1.1 #

The component library is now at https://una.serverpod.dev/, branded Serverpod Una (https://unakit.dev/ sends its visitors there).

Added #

  • Payment card fields: UnaCardNumberField, UnaCardExpiryField and UnaCardCvcField, with UnaCardBrand, UnaCardExpiry and their form fields (UnaCardNumberFormField, UnaCardExpiryFormField, UnaCardCvcFormField). They take digits only, as many as the card has, grouped as they are typed. A number has sixteen digits at most unless the field's maxLength says otherwise (19 for UnionPay's or Maestro's long numbers).
  • The software keyboard: a focused UnaTextField brings its whole field into view (the label, description and error of its form field with it, clear of the bars and a footer), not the caret alone; popovers, menus, select lists and showUnaPopover keep above the keyboard and are no taller than what it leaves; KeyboardAvoider, for a screen with no scaffold, and UnaSidebarScaffold.resizeToAvoidBottomInset; on Android and iOS a drag on a scroll view lets the keyboard go (UnaScrollBehavior(keyboardDismissBehavior:) says otherwise); a debug build says so when a focused field is behind the keyboard (KeyboardAvoider.debugCheckCoveredFields).
  • The una-overview skill has a keyboard guide (guides/keyboard.md), with expectFieldsClearTheKeyboard, a widget test that gives the view a keyboard.

Fixed #

  • Safari on an iPhone zoomed the page in, and left it zoomed, when a text field that Flutter had focused by itself (an autofocus, a field focused after a message was sent) was then tapped: Safari zooms for a text input under 16 pixels, and since Flutter 3.47 a Flutter page may zoom. A UnaTextField keeps the engine's hidden input at 16 pixels there, so there is nothing to zoom for; a pinch still zooms.
  • A field's focus ring was cut off at both sides in a sheet or a dialog whose content scrolled, and over the first field and under the last: the scrolling content is clipped by the surface's edges now, not by its own box.
  • A field focused in a sheet could end up behind the sheet's actions: the sheet eased after the keyboard and closed over the field once it had shown itself. A sheet follows the keyboard frame by frame, as a scaffold does.
  • A dialog told its content of the keyboard it had already made room for, so a scaffold or a list inside made room again.
  • A UnaChatList under a UnaScaffold hid its newest message behind the footer and its oldest behind the app bar. With no padding of its own it insets itself by the MediaQuery padding, as a ListView does.

0.1.0 #

The first release of una, a Flutter design system forked from shad 1.0.2, with its own default look, Flutter's vocabulary, form factors, motion, Liquid Glass on Apple platforms and many new components. It needs Flutter 3.50 or later (Dart 3.14). The example app is the component library, at https://una.serverpod.dev/; the source is at https://github.com/serverpod/una.

Changed from shad #

Types that are gone or renamed are written as shad spelled them (ShadRadioController). A member that is gone or renamed is written on the class's new name (UnaPopoverController.show was ShadPopoverController.show).

Names and vocabulary

  • The Shad prefix is Una: ShadButton → UnaButton, ShadTheme.of → UnaTheme.of, ShadThemeData → UnaThemeData, showShadDialog → showUnaDialog. Every component carries it, with everything named after one (its theme, controller, variants, form fields), and so do the theme types (UnaColorScheme, UnaTextTheme, UnaThemeMode). Utilities and tokens have no prefix: Gap, Pressable, Motion, StyleTokens, PhosphorIcon, the named colour schemes (SlateColorScheme).
  • Flutter names where they exist: ShadInput → UnaTextField, ShadInputFormField → UnaTextFormField, ShadInputOTP → UnaOtpField, ShadSeparator → UnaDivider, ShadProgress → UnaProgressBar, ShadOption → UnaSelectOption, ShadContextMenuItem → UnaMenuItem. Their themes follow (UnaThemeData.textFieldTheme, dividerTheme, progressBarTheme, …).
  • Everything @Deprecated in shad 1.0 is removed, and there are no deprecation shims for the renames below.
  • Flutter's WidgetState: ShadState and ShadStatesController are gone; UnaButton, UnaIconButton and UnaToggle take a WidgetStatesController (which changes its value set in place).
  • ShadAppType.shadcn → UnaAppType.standard.
  • No .raw constructors: UnaButton, UnaIconButton, UnaBadge, UnaToggle, UnaDialog, UnaAlert, UnaTableCell and UnaMenuItem take variant:; the named constructors are shortcuts. UnaSelect takes UnaSelectVariant.primary/search, UnaSelect.multiple multiple/multipleWithSearch. UnaDivider() is horizontal.
  • borderRadius for a BorderRadius on UnaCard, UnaDialog, UnaDivider, UnaMenubar, UnaSelectOption, UnaSkeleton, UnaSheet, their themes and UnaBorder; named corners follow (UnaCommand.itemBorderRadius, UnaCalendarTheme.dayButtonBorderRadius, …). UnaThemeData.radius stays.
  • cursor → mouseCursor (UnaButton, UnaIconButton, UnaGestureDetector, their themes, UnaMenubarTheme.buttonMouseCursor, UnaTabsTheme.tabMouseCursor); onHoverChange → onHover.
  • Open state: visible: → open: on UnaPopover, UnaContextMenu and UnaContextMenuRegion; onOpenChange → onOpenChanged; UnaSidebarScaffold.defaultOpen → initiallyOpen, its child → body. Controllers have isOpen, open(), close(), toggle(), setOpen(): UnaPopoverController.show/hide → open/close; UnaSidebarController.openMobile → isMobileOpen (openMobile(), closeMobile(), toggleMobile(), setMobileOpen()), and its toggle(isMobile:) → toggle().
  • onPressed → onTap on UnaCard, UnaTextField, UnaTextarea, UnaSelect and their form fields; onPressedAlwaysCalled/onPressedOutside → onTapAlwaysCalled/onTapOutside.
  • Icons are widgets: UnaAccordionItem.iconData, UnaResizablePanelGroup.handleIconData and UnaDialog.closeIconData are gone; UnaAccordionTheme.icon, UnaResizableTheme.handleIcon and the calendar's navigation icons are const widgets.
  • No textDirection parameters (UnaAlert, UnaBreadcrumb, UnaButton, UnaResizablePanelGroup, ShadRovingFocus, their themes, UnaSelectOption.direction): use a Directionality.
  • Smaller renames: UnaPopover(popover:) → builder:; UnaCommand.onItemSelected → onSelected; UnaProgressBar.semanticsLabel/ semanticsValue → semanticLabel/semanticValue, backgroundColor/minHeight → trackColor/height; UnaSidebarMenuButton.isActive/UnaSidebarMenuSubButton.isActive → selected; UnaCalendar.hideNavigation/hideWeekdayNames → showNavigation/showWeekdayNames; ShadDisabled(disabled:) → Disabled(enabled:); sublabel → description and direction → controlAffinity on checkboxes, radios and switches.
  • No longer exported: state classes (ShadAccordionState, ShadCollapsibleState, ShadContextMenuState, ShadCommandState, ShadInputOTPState, ShadSelectState, every form field's state), ShadMouseAreaSurface, ShadDefaultResizeGrip, ShadPanelInfo, ShadResizeResult, ShadIndeterminateProgress and ShadDeterminateProgress.

Look and theme

  • A new default look: UnaThemeData() is the fluid style on the Slate scheme. For the classic shadcn/ui look pass style: StyleTokens.crisp, colorScheme: const GraphiteColorScheme.light().
  • Four styles: fluid (default), crisp, pebble and sharp (from shadcn's Nova, Maia and Lyra); any token can be set with StyleTokens.copyWith.
  • Seven colour schemes: Slate (default), Ocean, Graphite, Forest, Iris, Ember and Rose (ColorSchemes, SlateColorScheme, …), light and dark. ShadBlueColorScheme, ShadNeutralColorScheme, ShadZincColorScheme, ShadStoneColorScheme, ShadAccentScheme and applyAccentScheme are gone: use copyWith, UnaColorScheme.applyAccent or UnaColorScheme.fromSeed.
  • Icons are Phosphor, not Lucide, bundled in six weights (PhosphorIconsRegular, PhosphorIconsBold, PhosphorIconsFill, PhosphorIconsLight, PhosphorIconsThin, PhosphorIconsDuotone). In a test, find them with find.bySubtype<Icon>().
  • Floating surfaces are glass in fluid (popovers, menus, select lists, the command palette, tooltips, toasts); UnaThemeData(menuTranslucent:) is three-state (null follows the style). Menu highlights are a wash of the menu's foreground, and UnaMenuAccent.bold no longer rewrites the scheme's accent.
  • Table rows have a faint hover and a tinted selection (UnaTableTheme.rowHoverColor, rowSelectedColor, footerColor, footerHoverColor).
  • UnaApp cross-fades a theme change (UnaCrossFadeTheme) instead of interpolating it.
  • A custom UnaThemeVariant implements every component theme, and UnaTextTheme.custom requires a caption style.

Motion

  • Motion comes from the theme, and flutter_animate is gone. Removed: effects/iconEffects, reverseDuration, popoverReverseDuration, and duration/curve on overlays, accordion, collapsible, checkbox, radio, switch and their themes; showUnaDialog(animateIn:, animateOut:, variant:) and UnaDialogTheme.animateIn/animateOut; the toast motion parameters; ShadSizeEffect, ShadPaddingEffect, ShadAnimEffect and the flutter_animate re-export. Use UnaThemeData(motion:) (Motion.none for none).
  • Controls scale slightly while pressed (UnaButtonTheme(pressScale: 1) turns it off), overlays grow from their anchor, tabs and menubar triggers share one travelling indicator, and UnaPageRoute slides as the platform's push does.

Buttons and pressing

  • One style: UnaButton, UnaIconButton and UnaToggle take a UnaButtonTheme (UnaToggleTheme) merged over the variant's in place of some thirty colour, size and decoration parameters; UnaMenuItem (UnaContextMenuTheme), UnaCard (UnaCardTheme), UnaDialog and UnaSheet likewise.
  • A label wider than its button ends in an ellipsis instead of overflowing: UnaButton lays its child out in the room that is left.
  • Rarer gestures are a UnaGestureDetector around the button. hoverStrategies, longPressDuration, ShadHoverStrategies, ShadHoverStrategy, UnaThemeData.hoverStrategies and UnaButton.canRequestFocus are gone.
  • A UnaButton or UnaIconButton with no onPressed, no onLongPress and not loading is disabled. UnaButtonSize.icon is removed: use UnaIconButton.
  • UnaBadge is a static pill: onPressed, enabled, hoverBackgroundColor and mouseCursor are gone (use a UnaChip); shape → borderRadius; UnaBadgeTheme.borderColor.
  • UnaGestureDetector reports true global positions (the shad #319 workaround is gone).
  • Focus shows only after the keyboard is used, as CSS's :focus-visible.

Overlays

  • One UnaPopoverController for popovers, context menus, tooltips and hover cards; ShadTooltipController and ShadContextMenuController are gone, showAt → openAt.
  • A controlled open hears its dismissal: UnaPopover, UnaContextMenu and UnaContextMenuRegion take onOpenChanged, called when a tap outside, Escape or the controller opens or closes the overlay. One that was dismissed stays closed until the parent changes open. UnaCollapsible takes a controlled open too.
  • Tap-region plumbing is internal: UnaPopover.areaGroupId, useSameGroupIdForChild, the context menus' groupId, onHoverArea and tap callbacks, and groupId on UnaSelect, UnaCalendar and UnaTimeField are gone (UnaPopover.groupId stays), as is UnaPopover.focusNode.
  • Dialogs and sheets have no close button by default: pass showCloseButton: true (closeIcon, closeButton), or set it on the theme; onDismissed reports a close. expandActionsWhenTiny and removeBorderRadiusWhenTiny are gone.
  • One toast system: ShadSonner and ShadToaster are one UnaToaster that UnaApp provides; UnaToaster.of(context).show(UnaToast(...)) returns an id for update and dismiss. UnaToastVariant is neutral, success, warning, destructive or loading; UnaToast.destructive and UnaToast.raw are gone; UnaThemeData.toastTheme/toasterTheme replace primaryToastTheme, destructiveToastTheme and sonnerTheme. Toasts have no close button: swipe, F6 and Escape.
  • Sheets rest on detents: UnaSheet(detents:) (UnaSheetDetent.content, medium, large, full, fraction, height) with a UnaSheetController replaces expandable, initialSize, minSize, maxSize, snap*, isScrollControlled, animationController, dragHandleBuilder and onSizeChanged. showUnaSheet takes dismissible (was isDismissible) and a builder that returns the UnaSheet.
  • UnaMenubarItem takes only child, items, leading, trailing, enabled and focusNode. UnaSelect has no scroll chevrons (showScrollToTopChevron, showScrollToBottomChevron).

Inputs and pickers

  • scribbleEnabled is gone from UnaTextField, UnaTextarea and their form fields: use stylusHandwritingEnabled, as Flutter does.
  • UnaSelect asserts that it is given value or initialValue, not both (values or initialValues on .multiple).
  • Value controls are controlled (value + onChanged, or initialValue): the controllers of UnaSlider, UnaRangeSlider, UnaRadioGroup (ShadRadioController), UnaToggleGroup (ShadToggleGroupController) and UnaSelect (ShadSelectController) are gone; UnaSelect.popoverController → controller, UnaSlider.label → semanticLabel, UnaCalendar.selected/UnaDatePicker.selected → value, UnaCalendar.fromMonth/toMonth → min/max.
  • One value, or a set: unnamed UnaSelect, UnaCalendar and UnaToggleGroup hold one value, .multiple a set (values, initialValues, onValuesChanged); UnaAccordion.multiple takes initialValues. UnaToggleGroup takes items (was children) and variant (was toggleVariant); ShadToggleGroupVariant is gone. allowDeselection is shared by selects, toggle groups and pickers.
  • A null callback disables a UnaToggleGroup, UnaRadioGroup or UnaSelect.
  • Pickers: the inline time picker is UnaTimeField (UnaTimeFormField); UnaTimePicker opens it in a popover, or wheels on a phone. UnaDatePicker.range → UnaDateRangePicker. ShadTimePickerController, ShadTimePickerField, ShadTimePickerVariant, UnaDatePicker.raw and ShadDatePickerVariant are gone; closeOnSelection defaults to true; TimeOfDay has no period. Picker triggers look like a text field unless given a variant:.
  • Text fields on a touch screen have selection handles, a toolbar and a magnifier by default.
  • Tabs are value-based: UnaTabBar<T> takes tabs: [UnaTab(value:, child:)], value and onChanged, and UnaTab is a data class. UnaTabs<T> lost tabsGap, dragStartBehavior, physics, padding, decoration, tabBarConstraints and contentConstraints; UnaTabsController.selected → value; UnaTabsTheme.tabBarAlignment → tabAlignment.

Added #

  • App structure: form factors (UnaApp(formFactor:), UnaThemeData.formFactor, FormFactorBuilder); GapSize, Gap, UnaPageContainer, UnaThemeData.layoutTheme; UnaScaffold (bars over the body, drawer, endDrawer, banner, footer, bottomSheet, floatingActionButton, UnaScaffold.withDrawerOf); UnaAppBar (translucent and UnaAppBarTheme.translucent: frosted or opaque, on una's own bar and on Liquid Glass; surfaceBuilder, a background of the app's own built from a UnaAppBarSurfaceState; UnaAppBar.usesLiquidGlass), UnaSliverAppBar (with no title only its buttons while the page is at its top, as discs on una's own bar, and its surface once the page scrolls under it), UnaSliverAppBar.large (bare until its title is in the toolbar; largeTitleStyle), UnaBackButton, UnaCloseButton, UnaFloatingActionButton, UnaToolbar, UnaListDetailLayout, OverlayInsets.
  • Navigation: UnaNavigationScaffold (layout: UnaNavigationLayout.auto, bottomBar, topBar, rail; showBottomBar, bottomBarBuilder, mobileAppBar, mobileActions, showMobileAppBar, railExtended, railTrailing, and UnaScaffold's drawer, endDrawer, floatingActionButton, banner, footer, bottomSheet), UnaNavigationBar, a floating UnaBottomNavigationBar, UnaNavigationDestination, UnaNavigationAction, DestinationStack, UnaNavigationMenu, UnaTabBarView, UnaRestorableTabsController, UnaSegmentedControl; back gestures on UnaPageRoute (iOS swipe, Android predictive back) and UnaPage.
  • Overlays: UnaActionSheet, showUnaActionSheet, UnaHoverCard, UnaPopover(showArrow:), UnaPopover.requestFocus, showUnaMenu; UnaMenuCheckboxItem, UnaMenuRadioGroup, UnaMenuRadioItem, UnaMenuLabel, UnaMenuDivider, UnaMenuShortcut; UnaSheet from any edge and inline.
  • Inputs: UnaTextField(clearable:, revealable:, showCounter:), UnaTextField.password, UnaSearchField, showUnaSearch, UnaAutocomplete, UnaNumberField, UnaTagField, UnaDateField, UnaRating, UnaColorPicker, UnaColorPickerButton, UnaWheelPicker, UnaTimeWheelPicker, UnaDateWheelPicker, UnaChip, UnaChipGroup, UnaCheckbox(tristate:), UnaOtpField(obscureText:), ControlSize.sm, touch text selection (UnaTextSelectionControls, UnaTextMagnifier, UnaSelectionArea), pickers in a sheet on a phone (PickerPresentation), and form fields for the new controls.
  • Lists and data: UnaListTile, UnaListSection, UnaSliverListSection, UnaSwitchListTile, UnaCheckboxListTile, UnaRadioListTile, UnaExpansionTile, UnaSwipeActions, UnaRefreshIndicator, UnaCarousel, UnaPageIndicator, UnaReorderableListView, UnaBoard, UnaChatList, UnaChatBubble, UnaTypingIndicator, UnaStreamingText, UnaDataTableController.remote, UnaAvatarGroup, UnaIconTile, UnaStatTile, UnaTimeline, UnaIndicatorBadge, UnaEmpty, UnaStepper, UnaResizableController.setSizes.
  • Charts: UnaLineChart, UnaBarChart, UnaDonutChart, UnaSparkline, UnaChartLegend, UnaChartTheme, and UnaChartPalette (UnaThemeData(chartPalette:)).
  • Buttons and feedback: UnaButton(loading:), UnaButtonVariant.glass, UnaButtonGroup, Pressable, FocusRing, UnaAlertVariant.success/warning/ info, UnaProgressRing, UnaSpinnerVariant (ring and una, a ring of dots with a wave running round it), UnaSkeleton.avatar, UnaSkeletonText, UnaSkeletonCard and more, UnaRevealImage, UnaLicensePage.
  • Theming: UnaColorScheme.fromSeed, UnaColorScheme.applyAccent, colour tokens tint, foregroundSubtle, success, warning, borderStrong, accentBorder and bar; UnaGlass, Backdrop and glass style tokens (UnaCardTheme(blur:) frosts cards); RadiusScale, UnaTextTheme.caption.
  • Motion: Motion (lively, calm, none) on the style, Motion.of(context) honouring reduced motion, and its building blocks (MotionSpring, SpringController, SpringBuilder, PressScale, MovingIndicator, Entrance, PopIn, AnimatedFill, …).
  • Liquid Glass on iOS and macOS, natively and in a browser, through liquid_glass_widgets: bars, floating surfaces, dialogs, sheets, UnaSwitch, UnaSlider and UnaSegmentedControl. UnaThemeData(liquidGlass: LiquidGlassTheme(mode:)) with LiquidGlassMode.auto, always or never, overridable per component theme; LiquidGlass.initialize() before runApp. The soft scroll edge under a glass bar with no title, and a docked bottom bar's, is a blur of the page and nothing over it: no wash of the page colour.
  • Icons and utilities: PhosphorIcon keeps a small icon's line weight (PhosphorIconTheme); Haptics (UnaThemeData(haptics: false)); DismissShortcut, isShownOnTop, Focusable.visibleOnly.
  • Accessibility and localisation: semantics roles and names on menus, tabs, dialogs, landmarks, sliders and pickers; fields named through semanticLabel or InputDecoratorScope; English UnaLocalizations strings for every new widget, which the other locales fall back to.

Fixed #

  • Popovers, menus, select lists, date pickers and tooltips stayed on screen when their anchor was hidden (IndexedStack, Offstage, an Opacity of zero, a kept-alive page).
  • A context menu at a point, showUnaMenu and showUnaPopover(anchorRect:) opened in the wrong place inside a nested navigator; an overlay moved to stay on screen touched the edge.
  • Escape in a submenu took three presses; the Escape that closed a popover, tooltip or select was reported as unhandled.
  • On the web, Enter did not activate buttons, checkboxes, radios, switches or accordion triggers, and arrow keys did not walk a menu or select.
  • A failed validation on an OTP, radio-group, time-picker or date-picker form field moved the focus to a node no widget owned.
  • Labels were cut off at larger text sizes in tabs, small buttons, toggles and calendar cells; the calendar, UnaSlider and UnaRangeSlider did not mirror right to left.
  • The date picker showed an empty row above the first week in a popover; a calendar whose value was set to null from outside kept its selection.
  • A disabled UnaButton was dimmed by a fixed half instead of UnaThemeData.disabledOpacity; UnaButtonTheme.pressedOffset was a fraction of the width; a UnaIconButton ignored its variant's size; buttons were not one semantics node.
  • Hover and selection fills flashed darker midway.
  • UnaProgressBar threw when it went indeterminate a second time; UnaTabs(restorationId:) threw for non-primitive values and UnaTabs(expandContent: true) in a scroll view.
  • UnaSidebarScaffold's shortcut acted under a dialog and took Ctrl+B from text fields; it is ⌘B on Apple platforms, Ctrl+B elsewhere.
  • An uncontrolled UnaSelect.multiple lost its choice when rebuilt; UnaSelect.withSearch with a custom search field ignored Space and Enter.
  • A menubar menu closed by a choice or Escape left the menubar open; a UnaContextMenu open from its first build did not take the focus; UnaContextMenuTheme.subMenuPadding did not reach submenus; a UnaPopover could not switch between controller: and open:.
  • Resetting a UnaForm called onChanged and onReset twice.
  • A slider thumb jumped when grabbed off-centre, and a sideways swipe in a pager moved the page rather than the thumb.
  • A sheet's barrier did not lighten while dragged; a dialog's barrier blur popped in at the end; a dialog's actions in a Wrap did not fill a phone's width.
  • A field with a custom border radius kept a focus ring of the theme's radius; merging a UnaRoundedSuperellipseBorder dropped its offset and padding.
  • Table hover was far too dark on a translucent muted, UnaTable.list never repainted its hover, and the UnaDataTable selection count was not localised.
  • UnaSelectOption.hoveredBackgroundColor was ignored; a controlled UnaToggleGroup called setState during build; a tooltip re-hovered while leaving disappeared anyway.
  • A narrow UnaDialog, an open UnaTooltip and a UnaApp with no theme derived the theme on every build, and UnaSpinner rebuilt on every frame.
  • Keyboard and assistive technology (reviewed against WAI-ARIA and WCAG 2.2 AA): checkboxes, switches and radios are one node with their label; radio and toggle groups and the calendar are one Tab stop walked with the arrows; sliders take Home, End and Page Up/Down; selects, the accordion, sortable UnaDataTable headers, dialogs, tooltips, menus and the menubar follow their ARIA patterns; collapsed content is out of the Tab order; UnaContextMenuRegion opens from the Menu key or Shift+F10.
11
likes
160
points
223
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A themeable Flutter design system: 100+ widgets, frosted-glass surfaces, desktop and phone metrics in one theme, Liquid Glass on iOS and macOS, and no Material dependency.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#user-interface #design-system #theming #material-alternative #widget

License

MIT (license)

Dependencies

boxy, collection, cupertino_icons, flutter, flutter_localizations, intl, liquid_glass_widgets, slang, slang_flutter, theme_extensions_builder_annotation, two_dimensional_scrollables, web

More

Packages that depend on una