ui library

Bloom UI primitives (shadcn-style components): button, card, dialog, ... Import alongside the core library: import 'package:bloom_js_native/ui.dart';

Classes

CommandItemConfig
Descriptor for a single command item in the command palette.
CommandPaletteConfig
Configuration descriptor for an active command palette overlay.
DialogConfig
Configuration descriptor for a global dialog overlay.
Configuration for a dropdown menu item.
Configuration descriptor for a navigation menu item.
SheetConfig
Configuration descriptor for slide-over side panels and drawers.
ToastItem
Descriptor representing an active toast notification item.

Enums

AlertVariant
AvatarSize
BadgeVariant
ButtonSize
ButtonVariant
ToastVariant
ToggleSize
Size options for toggle buttons.
ToggleVariant
Visual style variant for toggle buttons.

Constants

uiTokensCss → const String
Bloom UI Design Tokens.

Properties

activeCommandPalette → Signal<CommandPaletteConfig?>
Global active command palette state signal.
final
activeDialog → Signal<DialogConfig?>
Global active dialog state signal.
final
activeSheet → Signal<SheetConfig?>
Global active sheet / drawer state signal.
final
toastList → Signal<List<ToastItem>>
Global reactive signal list of active toast items.
final

Functions

accordion({required List<AccordionItem> items, bool allowMultiple = false, Set<String>? initialOpen, String extraClassName = ''}) → BloomNode
Accordion component primitive with local reactive state and smooth toggle animations.
alert({required String title, String? description, AlertVariant variant = AlertVariant.info, String? icon, BloomNode? action, String extraClassName = ''}) → BloomNode
Static inline alert banner primitive.
aspectRatio({required double ratio, required BloomNode child, String extraClassName = ''}) → BloomNode
Aspect ratio container component primitive.
avatar({String? src, String? alt, String? fallbackText, AvatarSize size = AvatarSize.md, String extraClassName = '', BloomNode? badge, Map<String, String> attrs = const {}}) → BloomNode
Avatar primitive with image and fallback initials.
avatarGroup({required List<BloomNode> children, String extraClassName = ''}) → BloomNode
Avatar group container overlapping multiple avatars.
badge({required String label, BadgeVariant variant = BadgeVariant.defaultVariant, void onDismiss()?, String? icon, String extraClassName = ''}) → BloomNode
Generic badge primitive for Bloom UI.
barChart({required List<ChartDataPoint> data, double? maxValue, double height = 160, String? color, String extraClassName = ''}) → BloomNode
Simple pure-SVG bar chart component.
Breadcrumb navigation hierarchy primitive.
button({required String text, BloomEventHandler? onClick, String? href, ButtonVariant variant = ButtonVariant.primary, ButtonSize size = ButtonSize.md, bool disabled = false, String? icon, bool loading = false, String extraClassName = '', Map<String, String> attrs = const {}, List<BloomNode>? children}) → BloomNode
Generic Button primitive for Bloom UI.
buttonClasses({ButtonVariant variant = ButtonVariant.primary, ButtonSize size = ButtonSize.md, String extraClassName = ''}) → String
Resolves CSS classes for ButtonVariant and ButtonSize.
calendar({required DateTime month, DateTime? selected, required void onSelect(DateTime date), required void onMonthChange(DateTime date), String extraClassName = ''}) → BloomNode
Controlled month-grid date picker component.
card({required List<BloomNode> children, String extraClassName = '', Map<String, String> attrs = const {}}) → BloomNode
Card container primitive.
cardContent({required List<BloomNode> children, String extraClassName = ''}) → BloomNode
Main body content section of a card.
cardDescription({required String text, String extraClassName = ''}) → BloomNode
Secondary description element inside cardHeader.
cardFooter({required List<BloomNode> children, String extraClassName = ''}) → BloomNode
Footer action section of a card.
cardHeader({required List<BloomNode> children, String extraClassName = ''}) → BloomNode
Header section of a card.
cardTitle({required String text, String extraClassName = ''}) → BloomNode
Title element inside cardHeader.
checkbox({required String id, String? name, bool checked = false, bool indeterminate = false, bool disabled = false, String? label, BloomNode? labelNode, BloomEventHandler? onChange, void onCheckedChange(bool)?, String extraClassName = '', Map<String, String> attrs = const {}}) → BloomNode
Checkbox primitive with label and indeterminate state support.
circularProgress({required double value, double max = 100, double size = 40, double strokeWidth = 3.5, String? color, String? label, bool showValue = false, String extraClassName = ''}) → BloomNode
Circular determinate progress indicator primitive.
closeCommandPalette() → void
Closes the currently active command palette.
closeDialog() → void
Closes the currently active dialog.
closeDrawer() → void
Closes the currently active drawer.
closeSheet() → void
Closes the currently active sheet / drawer.
cn(List<Object?> classes) → String
Plain Dart class name concatenation helper for Bloom UI primitives.
commandViewport() → BloomNode
Root viewport component for rendering the global command palette modal overlay.
contextMenu({required BloomNode child, required List<MenuItemConfig> items, String extraClassName = ''}) → BloomNode
Context menu descriptor triggered by right-click.
dialogViewport() → BloomNode
Root viewport component for rendering the active modal dialog.
dismissToast(String id) → void
Dismisses a toast by its id.
drawerViewport() → BloomNode
Viewport component for rendering active drawer/sheet modals.
Dropdown actions menu with local reactive state and backdrop click-to-close.
fieldGroup({required List<BloomNode> children, String extraClassName = ''}) → BloomNode
Field group container for stacking or arranging multiple fields.
fieldSet({required List<BloomNode> children, String? legend, String extraClassName = ''}) → BloomNode
Fieldset container grouping related form fields.
Returns a <link rel="stylesheet" href="..."> BloomNode referencing the self-hosted font stylesheet generated by bloom fonts optimize.
formField({required String label, required BloomNode control, String? id, String? error, String? help, bool required = false, String extraClassName = ''}) → BloomNode
Form field layout wrapper with label, control, and optional help or error text.
hoverCard({required BloomNode trigger, required BloomNode content, String side = 'bottom', String align = 'center', String extraClassName = ''}) → BloomNode
Pure CSS hover card preview component.
iconSvgString(String name, {String className = 'w-4 h-4'}) → String
Renders an inline SVG icon for Bloom UI primitives.
inputGroup({required List<BloomNode> children, String extraClassName = ''}) → BloomNode
Layout container for grouping an input control with leading/trailing addons.
inputGroupAddon({required List<BloomNode> children, String align = 'left', String extraClassName = ''}) → BloomNode
Addon container placed inside an inputGroup.
inputGroupText({required String text, String extraClassName = ''}) → BloomNode
Text label helper for inputGroupAddon.
inputOtp({required int length, required String value, required void onChange(String value), bool disabled = false, bool hasError = false, String extraClassName = ''}) → BloomNode
Controlled one-time password (OTP) / PIN input primitive.
label({String? text, String? htmlFor, bool required = false, String extraClassName = '', List<BloomNode>? children, Map<String, String> attrs = const {}}) → BloomNode
Form label primitive for Bloom UI.
Menubar component primitive.
Navigation menu component primitive.
nextPageHref(String path, Map<String, String> currentQuery, String nextCursor) → String
Builds a next page URL appending nextCursor to the back-stack query.
openAlertDialog({required String title, String? description, BloomNode? body, String confirmLabel = 'Continue', String cancelLabel = 'Cancel', bool destructive = true, required VoidCallback onConfirm, VoidCallback? onCancel}) → void
Opens an alert confirmation dialog (destructive action confirmation).
openCommandPalette(List<({String? group, String label, VoidCallback onSelect})> items, {String placeholder = 'Type a command or search...', VoidCallback? onClose}) → void
Opens the global command palette overlay.
openCommandPaletteDetailed({required List<CommandItemConfig> items, String placeholder = 'Type a command or search...', VoidCallback? onClose}) → void
Opens the global command palette with full item configuration.
openConfirmDialog({required String title, String? description, String confirmLabel = 'Confirm', String cancelLabel = 'Cancel', bool destructive = false, required VoidCallback onConfirm, VoidCallback? onCancel}) → void
Helper for standard confirmation dialogs.
openDialog({required String title, String? description, BloomNode? body, String? confirmLabel, String? cancelLabel, bool destructive = false, VoidCallback? onConfirm, VoidCallback? onCancel}) → void
Opens a general modal dialog.
openDrawer({required String title, String? description, BloomNode? body, String side = 'bottom', bool showCloseButton = true, VoidCallback? onClose}) → void
Opens a mobile-style bottom drawer (or customizable slide-over).
openSheet({required String title, String? description, BloomNode? body, String side = 'right', bool showCloseButton = true, VoidCallback? onClose}) → void
Opens a side-panel sheet.
paginationBar({required String currentPath, required Map<String, String> currentQuery, required int total, required int itemCount, String? nextCursor, int pageSize = 24, String extraClassName = ''}) → BloomNode
Reusable cursor-based pagination bar primitive.
popover({required BloomNode trigger, required BloomNode content, String align = 'center', String extraClassName = ''}) → BloomNode
Popover container with per-instance reactive state and backdrop click-to-close.
prevPageHref(String path, Map<String, String> currentQuery) → String
Builds a previous page URL restoring the cursor from the back-stack query.
progress({required double value, double max = 100.0, String? label, bool showValue = false, String extraClassName = ''}) → BloomNode
Determinate linear progress bar primitive.
radioGroup({required List<({String label, String value})> options, required String value, required void onChange(String value), String? name, bool disabled = false, String orientation = 'vertical', String extraClassName = ''}) → BloomNode
Controlled radio group primitive.
resizablePanels({required BloomNode first, required BloomNode second, bool vertical = false, double initialSplit = 0.5, double minSplit = 0.1, double maxSplit = 0.9, bool withHandle = true, String extraClassName = ''}) → BloomNode
Resizable split-pane layout component.
scrollArea({required BloomNode child, double? maxHeight, double? maxWidth, String orientation = 'vertical', String extraClassName = ''}) → BloomNode
Scroll area component with customized lightweight scrollbars.
selectInput({required String id, String? name, required String value, required List<({String label, String value})> options, bool disabled = false, bool hasError = false, String? placeholder, BloomEventHandler? onChange, void onValueChange(String)?, String extraClassName = '', Map<String, String> attrs = const {}}) → BloomNode
Native styled <select> dropdown primitive for Bloom UI.
separator({bool vertical = false, String extraClassName = '', Map<String, String> attrs = const {}}) → BloomNode
Horizontal or vertical divider primitive.
sheetViewport() → BloomNode
Root viewport component for rendering active slide-over sheets and bottom drawers.
showToast(String message, {ToastVariant variant = ToastVariant.info, Duration duration = const Duration(seconds: 4), String? actionLabel, void onAction()?}) → void
Dispatches a toast notification to the global toast queue.
skeleton({String extraClassName = '', String? style}) → BloomNode
Skeleton placeholder primitive with pulse loading animation.
slider({required double value, required double min, required double max, double step = 1, required void onChange(double value), bool disabled = false, String extraClassName = ''}) → BloomNode
Controlled range slider primitive.
sparkline({required List<double> values, double width = 120, double height = 32, String? color, String extraClassName = ''}) → BloomNode
Lightweight inline SVG sparkline component.
switchToggle({required bool checked, required void onChange(bool), bool disabled = false, String? id, String? name, String extraClassName = ''}) → BloomNode
Toggle switch primitive (named switchToggle as switch is a reserved word in Dart).
table({required List<BloomNode> children, String extraClassName = ''}) → BloomNode
Semantic <table> wrapper container primitive.
tableBody({required List<BloomNode> children, String extraClassName = ''}) → BloomNode
Semantic <tbody> table body element.
tableCaption({required String text, String extraClassName = ''}) → BloomNode
Semantic <caption> table caption element.
tableCell({String? text, List<BloomNode>? children, String extraClassName = '', int? colSpan, int? rowSpan}) → BloomNode
Semantic <td> table data cell element.
tableFooter({required List<BloomNode> children, String extraClassName = ''}) → BloomNode
Semantic <tfoot> table footer element.
tableHead({String? text, List<BloomNode>? children, String extraClassName = '', int? colSpan, int? rowSpan}) → BloomNode
Semantic <th> table header cell element.
tableHeader({required List<BloomNode> children, String extraClassName = ''}) → BloomNode
Semantic <thead> table header element.
tableRow({required List<BloomNode> children, String extraClassName = '', BloomEventHandler? onClick}) → BloomNode
Semantic <tr> table row element.
tabs({required List<({String key, String label})> items, required String activeKey, required void onChange(String key), required BloomNode content(String key), String extraClassName = ''}) → BloomNode
Controlled tabs component.
textarea({required String id, String? name, String? value, String? placeholder, int rows = 4, int? cols, bool disabled = false, bool required = false, bool hasError = false, String? ariaDescribedBy, String extraClassName = '', BloomEventHandler? onInput, BloomEventHandler? onChange, BloomEventHandler? onFocus, BloomEventHandler? onBlur, Map<String, String> attrs = const {}}) → BloomNode
Multi-line text editing primitive for Bloom UI.
textInput({required String id, String? name, String? value, String? placeholder, String type = 'text', String? prefix, BloomNode? prefixNode, String? suffix, BloomNode? suffixNode, bool disabled = false, bool required = false, bool hasError = false, String? ariaDescribedBy, String extraClassName = '', BloomEventHandler? onInput, BloomEventHandler? onChange, BloomEventHandler? onKeyDown, BloomEventHandler? onFocus, BloomEventHandler? onBlur, Map<String, String> attrs = const {}}) → BloomNode
Text input primitive for Bloom UI.
toastViewport() → BloomNode
Viewport container mounted at application root to render active toasts.
toggle({required bool pressed, required void onChange(bool pressed), required BloomNode child, ToggleVariant variant = ToggleVariant.defaultVariant, ToggleSize size = ToggleSize.defaultSize, bool disabled = false, String extraClassName = ''}) → BloomNode
Single two-state toggle button primitive.
toggleGroupMultiple<T>({required List<ToggleGroupItem<T>> items, required Set<T> value, required void onChange(Set<T> value), ToggleVariant variant = ToggleVariant.defaultVariant, ToggleSize size = ToggleSize.defaultSize, String orientation = 'horizontal', String extraClassName = ''}) → BloomNode
Controlled toggle group supporting multiple selections.
toggleGroupSingle<T>({required List<ToggleGroupItem<T>> items, required T? value, required void onChange(T value), ToggleVariant variant = ToggleVariant.defaultVariant, ToggleSize size = ToggleSize.defaultSize, String orientation = 'horizontal', String extraClassName = ''}) → BloomNode
Controlled toggle group supporting single-selection.
tooltip({required String label, required BloomNode child, String side = 'top', String extraClassName = ''}) → BloomNode
Pure CSS tooltip component with hover and focus-within reveal triggers.
uiIcon(String name, {String className = 'w-4 h-4'}) → BloomNode
Helper returning a BloomNode for an icon name.

Typedefs

AccordionItem = ({BloomNode content, String id, String title})
Accordion item descriptor.
ChartDataPoint = ({String label, double value})
Data point for a simple bar chart.
Single top-level menu in a menubar.
ToggleGroupItem<T> = ({String? ariaLabel, BloomNode child, T value})
Single item in a toggleGroupSingle or toggleGroupMultiple.
VoidCallback = void Function()