Types
All public TypeScript types are exported from @flux-ui/types. This page lists the types you'll most commonly run into when consuming the components — the ones that show up in component props, slot bindings and store helpers.
import type { FluxColor, FluxIconName, FluxSize } from '@flux-ui/types';Common
FluxAlignment
type FluxAlignment = 'start' | 'center' | 'end';Used by layout components such as Overflow bar and Flex.
FluxColor
type FluxColor = 'gray' | 'primary' | 'danger' | 'info' | 'success' | 'warning';The six semantic colours that drive everything from Badge and Notice to Avatar status dots.
FluxDirection
type FluxDirection = 'horizontal' | 'vertical';FluxIconName
type FluxIconName = string; // re-export of FontAwesome's IconNameAny Font Awesome icon name. The icon must be registered through fluxRegisterIcons before it can be used.
FluxInputMask
type FluxInputMask = 'bic' | 'iban' | 'vat';The built-in masks for Form input.
FluxInputType
type FluxInputType =
| 'color'
| 'date'
| 'datetime-local'
| 'email'
| 'file'
| 'month'
| 'number'
| 'password'
| 'search'
| 'tel'
| 'text'
| 'time'
| 'url'
| 'week';FluxPressableType
type FluxPressableType = 'button' | 'link' | 'route' | 'none';Determines how a pressable component renders — as a <button>, an <a> link, a Vue Router <RouterLink>, or as a non-interactive element.
FluxSize
type FluxSize = 'small' | 'medium' | 'large';FluxTo
type FluxTo = {
name?: string;
path?: string;
hash?: string;
query?: Record<string, string | (string | null)[] | null | undefined>;
params?: Record<string, string | number>;
state?: Record<string, string | number | boolean>;
append?: boolean;
replace?: boolean;
};The Vue Router location object accepted by every to prop. Forwarded directly to <RouterLink>.
FluxAutoCompleteType
A union of every valid HTML autocomplete token (name, email, cc-number, address-level2, etc.) plus their grouped variants (shipping email, billing tel, …). Accepts arbitrary strings as a fallback.
FluxMaybePromise
type FluxMaybePromise<T> = T | Promise<T>;Used by APIs that accept either a synchronous or an asynchronous value.
Forms
FluxFormInputBaseProps
type FluxFormInputBaseProps = {
readonly autoFocus?: boolean;
readonly disabled?: boolean;
readonly error?: string | null;
readonly isCondensed?: boolean;
readonly isLoading?: boolean;
readonly isReadonly?: boolean;
readonly isSecondary?: boolean;
readonly name?: string;
readonly placeholder?: string;
};The shared shape of every form input component (FluxFormInput, FluxFormSelect, FluxFormDateInput, …). Reuse it when you build your own input wrappers.
FluxFormSelectEntry
type FluxFormSelectGroup = {
readonly icon?: FluxIconName;
readonly label: string;
readonly value?: never;
};
type FluxFormSelectOption = {
readonly badge?: string;
readonly command?: string;
readonly commandIcon?: FluxIconName;
readonly icon?: FluxIconName;
readonly imageAlt?: string;
readonly imageSrc?: string;
readonly label: string;
readonly selectable?: boolean;
readonly value: string | number | null;
};
type FluxFormSelectEntry = FluxFormSelectGroup | FluxFormSelectOption;The shape of items inside Form select. Use isFluxFormSelectGroup and isFluxFormSelectOption to narrow at runtime.
FluxFormSelectValue
type FluxFormSelectValueSingle = string | number | null;
type FluxFormSelectValue = FluxFormSelectValueSingle | FluxFormSelectValueSingle[];FluxFormTreeViewSelectOption
type FluxFormTreeViewSelectOption = {
readonly id: string | number;
readonly label: string;
readonly icon?: FluxIconName;
readonly selectable?: boolean;
readonly children?: FluxFormTreeViewSelectOption[];
};The shape of items inside Tree view select.
Filters
FluxFilterState
type FluxFilterValueSingle = DateTime | string | boolean | number | null;
type FluxFilterValue = FluxFilterValueSingle | FluxFilterValueSingle[];
type FluxFilterState<T extends Record<string, unknown> = Record<string, FluxFilterValue>> = T;The current value of a Filter keyed by filter name. Pass a generic to type the state shape for custom filter types.
FluxFilterDefinition
type FluxFilterDefinition<TValue = FluxFilterValue> = {
readonly type: string;
readonly name: string;
readonly label: string;
readonly icon?: FluxIconName;
readonly disabled?: boolean;
readonly defaultValue?: TValue;
getValueLabel(value: TValue): Promise<string | null>;
onChange?(value: TValue): void;
onClear?(): void;
};The runtime metadata returned by a filter component's __filterDefinitionFactory. Built via defineFilter inside defineOptions. FluxFilterBase calls the factory on each slot VNode to build the menu, badge labels and lifecycle hooks.
Notify objects
The objects passed to the programmatic Alert, Confirm, Prompt, Snackbar and tooltip APIs.
FluxAlertObject
type FluxAlertObject = {
readonly id: number;
readonly icon?: FluxIconName;
readonly title: string;
readonly message: string;
onClose(): void;
};FluxConfirmObject
type FluxConfirmObject = FluxAlertObject & {
onCancel(): void;
onConfirm(): void;
};FluxPromptObject
type FluxPromptObject = FluxAlertObject & {
readonly fieldLabel: string;
readonly fieldPlaceholder?: string;
readonly fieldType?: FluxInputType;
onCancel(): void;
onConfirm(text: string): void;
};FluxSnackbarObject
type FluxSnackbarObject = {
readonly id: number;
readonly actions?: Record<string, string>;
readonly color?: FluxColor;
readonly icon?: FluxIconName;
readonly isCloseable?: boolean;
readonly isLoading?: boolean;
readonly isRendered?: boolean;
readonly message?: string;
readonly progressIndeterminate?: boolean;
readonly progressMax?: number;
readonly progressMin?: number;
readonly progressStatus?: string;
readonly progressValue?: number;
readonly subMessage?: string;
readonly title?: string;
onAction?(actionKey: string): void;
onClose?(): void;
};Component-specific types
These types are exported from @flux-ui/types but are typically only referenced when you wrap or extend the corresponding component:
Type | Used by |
|---|---|
FluxButtonProps / FluxButtonEmits / FluxButtonSlots | Button variants |
FluxButtonSize | |
FluxCommandSource / FluxCommandSourceItem / FluxCommandSubAction | |
FluxFocalPointObject | |
FluxTreeViewOption |
Statistics
FluxStatisticsChange
type FluxStatisticsChange = {
readonly color?: FluxColor;
readonly icon?: FluxIconName;
readonly value: string;
};The trend indicator passed to FluxStatisticsKpi and FluxStatisticsChange.