View as Markdown

API reference: @salmonui/navigation/tabs

TabsPropsinterface

import type { TabsProps } from '@salmonui/navigation/tabs';
interface TabsProps extends RootDomProps {
    readonly children?: ReactNode;
    readonly value?: string | undefined;
    readonly defaultValue?: string;
    readonly onValueChange?: (value: string, event: TabsValueChangeEvent) => void;
    readonly onBeforeValueChange?: (event: TabsBeforeValueChangeEvent) => void;
    readonly placement?: TabsPlacement;
    readonly activation?: TabsActivation;
    readonly panelMount?: TabsPanelMount;
    readonly overflow?: TabsOverflow;
    readonly scrollStep?: number;
    readonly disabled?: boolean;
    readonly reorderable?: boolean;
    readonly onBeforeReorder?: (event: TabsBeforeReorderEvent) => void;
    readonly onReorder?: (event: TabsReorderEvent) => void;
    readonly localeText?: Partial<TabsLocaleText>;
    readonly className?: string;
    readonly style?: CSSProperties;
    readonly ref?: Ref<HTMLDivElement>;
}
TabsProps members (18)
NameSignatureDescription
childrenoptionalreadonly children?: ReactNode;

TabList and TabPanel elements (in any order; placement arranges them).

valueoptionalreadonly value?: string | undefined;

Selected tab value (controlled).

defaultValueoptionalreadonly defaultValue?: string;

Initial selected value; without value and defaultValue the first enabled tab is selected after mount.

onValueChangeoptionalreadonly onValueChange?: (value: string, event: TabsValueChangeEvent) => void;
onBeforeValueChangeoptionalreadonly onBeforeValueChange?: (event: TabsBeforeValueChangeEvent) => void;

Runs before a selection change; event.preventDefault() keeps the current tab.

placementoptionalreadonly placement?: TabsPlacement;

Side of the panels the tab list sits on. Default 'top'; 'start' / 'end' make the list vertical.

activationoptionalreadonly activation?: TabsActivation;

Default 'automatic' (selection follows focus).

panelMountoptionalreadonly panelMount?: TabsPanelMount;

Default 'lazy'.

overflowoptionalreadonly overflow?: TabsOverflow;

Default 'scroll'.

scrollStepoptionalreadonly scrollStep?: number;

Pixels per scroll button press (overflow="scroll"). Default 100.

disabledoptionalreadonly disabled?: boolean;

Disables every tab.

reorderableoptionalreadonly reorderable?: boolean;

Tabs can be reordered by pointer drag and Alt+Arrow keys; the application moves the tab in onReorder.

onBeforeReorderoptionalreadonly onBeforeReorder?: (event: TabsBeforeReorderEvent) => void;
onReorderoptionalreadonly onReorder?: (event: TabsReorderEvent) => void;
localeTextoptionalreadonly localeText?: Partial<TabsLocaleText>;
classNameoptionalreadonly className?: string;
styleoptionalreadonly style?: CSSProperties;
refoptionalreadonly ref?: Ref<HTMLDivElement>;

The root element.