API reference: @salmonui/layout/splitter
SplitterPropsinterface
import type { SplitterProps } from '@salmonui/layout/splitter';interface SplitterProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onResize'> {
readonly children?: ReactNode;
readonly panes?: readonly (SplitterPaneProps & {
readonly content?: ReactNode;
})[] | undefined;
readonly orientation?: 'horizontal' | 'vertical' | undefined;
readonly sizes?: Readonly<Record<string, SplitterSize>> | undefined;
readonly defaultSizes?: Readonly<Record<string, SplitterSize>> | undefined;
readonly onSizesChange?: ((sizes: Record<string, SplitterSize>) => void) | undefined;
readonly onResizeStart?: ((paneIds: readonly [
string,
string
]) => void) | undefined;
readonly onResize?: ((sizes: Readonly<Record<string, number>>) => void) | undefined;
readonly disabled?: boolean | undefined;
readonly localeText?: SplitterLocaleText | undefined;
readonly ref?: Ref<HTMLDivElement> | undefined;
}
| Name | Signature | Description |
|---|---|---|
childrenoptional | readonly children?: ReactNode; |
|
panesoptional | readonly panes?: readonly (SplitterPaneProps & {
readonly content?: ReactNode;
})[] | undefined; | Data form of the panes (props of |
orientationoptional | readonly orientation?: 'horizontal' | 'vertical' | undefined; | Default |
sizesoptional | readonly sizes?: Readonly<Record<string, SplitterSize>> | undefined; | Controlled sizes by pane id (panes without a size share the rest). |
defaultSizesoptional | readonly defaultSizes?: Readonly<Record<string, SplitterSize>> | undefined; | |
onSizesChangeoptional | readonly onSizesChange?: ((sizes: Record<string, SplitterSize>) => void) | undefined; | Once at the end of a resize (pointer release or a key press), sizes in each pane's unit. |
onResizeStartoptional | readonly onResizeStart?: ((paneIds: readonly [
string,
string
]) => void) | undefined; | |
onResizeoptional | readonly onResize?: ((sizes: Readonly<Record<string, number>>) => void) | undefined; | Once per animation frame during a drag, px sizes of the two panes; not for React state. |
disabledoptional | readonly disabled?: boolean | undefined; | Separators are inert. |
localeTextoptional | readonly localeText?: SplitterLocaleText | undefined; | |
refoptional | readonly ref?: Ref<HTMLDivElement> | undefined; | The splitter element. |