Component Props

Wire a Tilery component with renderers, behavior controls, actions, and callbacks.

How to read this page

The Tilery component is the integration boundary for React apps. Start with rendering props, then add behavior, sizing, actions, and callbacks as your product needs them.

<Tilery
  initialLayout={layout}
  renderTabHeader={(tab) => <span>{tab.data.title}</span>}
  renderTabContent={(tab) => <Editor tab={tab} />}
/>

Required rendering props

Use these when mounting a Tilery instance. initialLayout describes the workspace, while the render functions connect your app data to the tab UI and panel content.

PropTypeRequiredDescription
initialLayoutTileryInitialLayout<TData>YesInitial panel and tab configuration.
renderTabHeader(tab: TileryTab<TData>, ctx: { isActive: boolean }) => ReactNodeYesRenders tab button content.
renderTabContent(tab: TileryTab<TData>) => ReactNodeYesRenders tab panel content.

Custom tab triggers

Use renderTabTrigger when the tab itself needs to render as a link or router component. Keep link metadata in your tab data; Tilery supplies the props that preserve selection, drag, and accessibility behavior.

<Tilery<TabData>
  initialLayout={layout}
  renderTabHeader={(tab) => <span>{tab.data.title}</span>}
  renderTabTrigger={({ tab, props, children }) =>
    tab.data.href ? (
      <a href={tab.data.href} {...props}>
        {children}
      </a>
    ) : (
      <div {...props}>{children}</div>
    )
  }
  renderTabContent={(tab) => <Editor tab={tab} />}
/>

For client-side routing, render your router link component in the same slot and spread props onto the component. The close button stays outside the trigger, so link tabs do not wrap button controls.

Layout behavior and sizing

Use these when the whole instance needs global resize behavior or a default panel constraint. Per-panel constraints still belong in the layout tree.

PropTypeRequiredDescription
minSizeTilerySizeNoDefault minimum panel size constraint.
resizablebooleanNoEnables or disables all resize handles.
resizeHandleHitSizenumberNoPointer hit target size for dividers and T-junction resize controls.

Panel actions and new tabs

Use these when the tab bar needs product-specific controls. Built-in panel actions cover common workspace operations, while custom actions and onNewTab let the app decide what a new tab means.

PropTypeRequiredDescription
showActionsButtonboolean | (panel: TileryPanel) => booleanNoShows the built-in panel action menu.
showNewTabButtonboolean | (panel: TileryPanel) => booleanNoShows the optional new-tab button.
onNewTab(panel, ctx) => TileryTabInit<TData> | voidNoResponds to the new-tab button.
renderPanelActions(panel, ctx) => ReactNodeNoAppends custom content to the panel action menu.
renderActionsButtonIcon(panel) => ReactNodeNoCustomizes the action menu button icon.

State and lifecycle callbacks

Use onChange for persistence, resize callbacks for layout telemetry, and lifecycle callbacks when your app needs structured events for tab or panel changes.

PropTypeRequiredDescription
onChange(state: TileryLayoutState) => voidNoCalled after every state change.
onResize(event: TileryResizeEvent) => voidNoCalled for each divider or junction resize.
onResizeEnd(event: TileryResizeEvent) => voidNoCalled when a resize interaction commits.
onActiveTabChange(event: TileryActiveTabChangeEvent) => voidNoCalled when a panel’s active tab changes.
onTabsMove(event: TileryTabsMoveEvent<TData>) => voidNoCalled when tabs move between panels or indexes.
onPanelsOpen(event: TileryPanelsOpenEvent<TData>) => voidNoCalled when panels are created.
onPanelSplit(event: TileryPanelSplitEvent<TData>) => voidNoCalled when a panel is split.
onTabsOpen(event: TileryTabsOpenEvent<TData>) => voidNoCalled when tabs are added.
onTabsClose(event: TileryTabsCloseEvent<TData>) => voidNoCalled when tabs are removed.
onPanelsClose(event: TileryPanelsCloseEvent<TData>) => voidNoCalled when panels are removed.

Controller ref

Use the ref when your app needs to open files, focus panels, restore snapshots, or perform other imperative workflows.

PropTypeRequiredDescription
refRef<TileryController>NoController ref for programmatic control.