View as Markdown

API reference: @salmonui/navigation/tabs

TabPropsinterface

import type { TabProps } from '@salmonui/navigation/tabs';
interface TabProps extends TabDomProps {
    readonly value: string;
    readonly children?: ReactNode;
    readonly icon?: ReactNode;
    readonly iconPlacement?: TabIconPlacement;
    readonly disabled?: boolean | undefined;
    readonly hidden?: boolean | undefined;
    readonly onClose?: ((event: TabCloseEvent) => void) | undefined;
    readonly render?: ((props: TabRenderProps) => ReactElement) | undefined;
    readonly className?: string;
    readonly style?: CSSProperties;
    readonly ref?: Ref<HTMLElement>;
}
TabProps members (11)
NameSignatureDescription
valuereadonly value: string;

Stable key of the tab; matches its TabPanel value.

childrenoptionalreadonly children?: ReactNode;

The label.

iconoptionalreadonly icon?: ReactNode;

Decorative icon (aria-hidden).

iconPlacementoptionalreadonly iconPlacement?: TabIconPlacement;

Default 'start'.

disabledoptionalreadonly disabled?: boolean | undefined;

aria-disabled="true": skipped by arrow keys, not selectable.

hiddenoptionalreadonly hidden?: boolean | undefined;

Not shown (the element stays in the DOM with hidden).

onCloseoptionalreadonly onClose?: ((event: TabCloseEvent) => void) | undefined;

Shows a close button and handles Delete on the focused tab; the application removes the tab.

renderoptionalreadonly render?: ((props: TabRenderProps) => ReactElement) | undefined;

Custom element (a router link); receives every computed prop.

classNameoptionalreadonly className?: string;
styleoptionalreadonly style?: CSSProperties;
refoptionalreadonly ref?: Ref<HTMLElement>;

The role="tab" element.