Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SplitsProps<T>

Parameters to the Splits component

Type parameters

  • T = {}

    type of the split items (drag data) we might receive

Hierarchy

  • SplitsProps

Index

Properties

children

children: ReactNode | SplitData<ReactNode>

The split data tree which might only consist of a single leaf.

Optional minSize

minSize: number

The minimum allowed size of a split. Smaller splits than this will grow up to the smaller of this limit or their equal fraction of the container.

Optional onResize

onResize: (path: number[], after: number, amount: number) => void

Called when a cell is resized. You should pass the arguments as they are to resizeSplit and then call fixSplitSizes to eliminate negative sizes or other problems.

Type declaration

    • (path: number[], after: number, amount: number): void
    • Parameters

      • path: number[]
      • after: number
      • amount: number

      Returns void

Optional onSplit

onSplit: (path: number[], side: Side, item: T, type: string) => void

Called when an item of a known type is dragged onto a split drop area. Pass the arguments as they are to subdivideSplit and then call fixSplitTree to normalise topology and fixSplitSizes to avoid negative sizes and similar issues.

Type declaration

    • (path: number[], side: Side, item: T, type: string): void
    • Parameters

      • path: number[]
      • side: Side
      • item: T
      • type: string

      Returns void

Optional splitTypes

splitTypes: string | string[]

Will handle react-dnd drops for these item types.

Generated using TypeDoc