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 Stack.
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 = Record<string, FluxFilterValue>;The current value of a Filter keyed by filter name.
FluxFilterSpecMap / FluxFilterEntryMap
These two record types map filter type names ('date', 'option', 'optionAsync', …) to their corresponding spec and entry types — useful when you build a generic filter wrapper.
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 | |
FluxLegendObject | |
FluxPercentageBarItemObject | |
FluxSegmentedControlItemObject | |
FluxTreeViewOption |
Statistics
FluxStatisticsChange
type FluxStatisticsChange = {
readonly color?: FluxColor;
readonly icon?: FluxIconName;
readonly value: string;
};The trend indicator passed to FluxStatisticsKpi and FluxStatisticsChange.