API reference: @salmonui/layout/dashboard-layout
DashboardLayoutPropsinterface
import type { DashboardLayoutProps } from '@salmonui/layout/dashboard-layout';interface DashboardLayoutProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onChange'> {
readonly children?: ReactNode;
readonly columns?: number | undefined;
readonly gap?: number | readonly [
number,
number
] | undefined;
readonly rowHeight?: number | undefined;
readonly cellAspectRatio?: number | undefined;
readonly showGridLines?: boolean | undefined;
readonly layout?: readonly DashboardLayoutItem[] | undefined;
readonly defaultLayout?: readonly DashboardLayoutItem[] | undefined;
readonly onLayoutChange?: ((layout: DashboardLayoutItem[]) => void) | undefined;
readonly draggable?: boolean | undefined;
readonly dragHandle?: string | undefined;
readonly resizable?: boolean | readonly DashboardResizeEdge[] | undefined;
readonly compact?: GridCompact | undefined;
readonly responsive?: {
readonly stackBelow?: number | undefined;
} | undefined;
readonly localeText?: DashboardLayoutLocaleText | undefined;
readonly ref?: Ref<HTMLDivElement> | undefined;
}
| Name | Signature | Description |
|---|---|---|
childrenoptional | readonly children?: ReactNode; |
|
columnsoptional | readonly columns?: number | undefined; | Column count. Default 12. |
gapoptional | readonly gap?: number | readonly [
number,
number
] | undefined; | Space between cells in px: one value, or |
rowHeightoptional | readonly rowHeight?: number | undefined; | Row height in px. Without it rows follow |
cellAspectRatiooptional | readonly cellAspectRatio?: number | undefined; | Cell width / height when |
showGridLinesoptional | readonly showGridLines?: boolean | undefined; | |
layoutoptional | readonly layout?: readonly DashboardLayoutItem[] | undefined; | Controlled layout (the serialized form). |
defaultLayoutoptional | readonly defaultLayout?: readonly DashboardLayoutItem[] | undefined; | |
onLayoutChangeoptional | readonly onLayoutChange?: ((layout: DashboardLayoutItem[]) => void) | undefined; | Once per committed drag, resize or keyboard drop, with every panel's item. |
draggableoptional | readonly draggable?: boolean | undefined; | Panels move with the pointer and the keyboard. Default true. |
dragHandleoptional | readonly dragHandle?: string | undefined; | CSS selector of the drag handle inside a panel; default the whole panel. |
resizableoptional | readonly resizable?: boolean | readonly DashboardResizeEdge[] | undefined; | Resize handles: true is |
compactoptional | readonly compact?: GridCompact | undefined; |
|
responsiveoptional | readonly responsive?: {
readonly stackBelow?: number | undefined;
} | undefined; |
|
localeTextoptional | readonly localeText?: DashboardLayoutLocaleText | undefined; | |
refoptional | readonly ref?: Ref<HTMLDivElement> | undefined; | The root element. |