Slots & owner state
Component overrides, slot props, and the state exposed to customization callbacks.
Usage
import type { GanttBarsSlots } from "@art-tools/react-gantt";
const bars: GanttBarsSlots = {
taskBar: {
slotProps: {
root: { className: "my-task-bar" },
},
},
};
// <Gantt tasks={tasks} bars={bars} />- slots replaces an element or component. slotProps supplies props directly or through an ownerState callback. The types below describe each component's available slots and state.
- mergeSlotProps combines class names and shallow-merges styles, with consumer styles taking precedence. Other props replace internal values, including event handlers, so preserve required behavior when overriding a handler.
- On Gantt, customization is grouped under taskList, bars, dependencySlots, and timeline. On the composable path, GanttSlotsProvider receives bars, dependencies, and timeline through value; TaskList receives its slots directly.
- The remaining exports below include per-component slot configurations, owner states, and dependency geometry used by those states. Import them as types when annotating custom renderers.
GanttSlotsProvider
Componentexport declare function GanttSlotsProvider(props: {
value: GanttSlotsValue;
children: ReactNode;
}): JSX.Element;useGanttSlots
FunctionRead the grid-side slot groups. Returns `{}` outside a provider.
/** Read the grid-side slot groups. Returns `{}` outside a provider. */
export declare function useGanttSlots(): GanttSlotsValue;GanttSlotsValue
TypeThe grid-side slot groups delivered through context (bars/dependencies/ timeline). The `taskList` group is prop-drilled separately and is NOT here.
| Property | Type & description |
|---|---|
barsOptional | GanttBarsSlots |
dependenciesOptional | GanttDependenciesSlots |
timelineOptional | GanttTimelineSlots |
TypeScript declaration
/**
* The grid-side slot groups delivered through context (bars/dependencies/
* timeline). The `taskList` group is prop-drilled separately and is NOT here.
*/
export declare interface GanttSlotsValue {
bars?: GanttBarsSlots;
dependencies?: GanttDependenciesSlots;
timeline?: GanttTimelineSlots;
}Slots for the task-list pane. Delivered by prop-drilling (see `<Gantt taskList>`).
| Property | Type & description |
|---|---|
treeCellOptional | TreeCellSlotConfig |
headerOptional | TaskListHeaderSlotConfig |
TypeScript declaration
/** Slots for the task-list pane. Delivered by prop-drilling (see `<Gantt taskList>`). */
export declare interface GanttTaskListSlots {
treeCell?: TreeCellSlotConfig;
header?: TaskListHeaderSlotConfig;
}GanttBarsSlots
TypeSlots for the timeline bars and their handles. Delivered via context.
| Property | Type & description |
|---|---|
baselineOptional | BaselineSlotConfig |
taskBarOptional | TaskBarSlotConfig |
projectBarOptional | ProjectBarSlotConfig |
milestoneBarOptional | MilestoneBarSlotConfig |
barProgressOptional | BarProgressSlotConfig |
barProgressResizeHandleOptional | BarProgressResizeHandleSlotConfig |
taskResizerOptional | TaskResizerSlotConfig |
connectorHandlesOptional | ConnectorHandlesSlotConfig |
tooltipOptional | BarTooltipSlotConfigOne slot for all three bar types, rendered by `DraggableBar` so it is scoped to the bar's own hover. Empty by default: no tooltip is rendered and the bar keeps its native `title`. Note it is lost if `slots.root` is replaced, since `DraggableBar` is only the default root (ADR-022). |
TypeScript declaration
/** Slots for the timeline bars and their handles. Delivered via context. */
export declare interface GanttBarsSlots {
baseline?: BaselineSlotConfig;
taskBar?: TaskBarSlotConfig;
projectBar?: ProjectBarSlotConfig;
milestoneBar?: MilestoneBarSlotConfig;
barProgress?: BarProgressSlotConfig;
barProgressResizeHandle?: BarProgressResizeHandleSlotConfig;
taskResizer?: TaskResizerSlotConfig;
connectorHandles?: ConnectorHandlesSlotConfig;
/**
* One slot for all three bar types, rendered by `DraggableBar` so it is
* scoped to the bar's own hover. Empty by default: no tooltip is rendered and
* the bar keeps its native `title`. Note it is lost if `slots.root` is
* replaced, since `DraggableBar` is only the default root (ADR-022).
*/
tooltip?: BarTooltipSlotConfig;
}Slots for dependency links. Delivered via context.
| Property | Type & description |
|---|---|
linksOptional | DependencyLinksSlotConfig |
previewOptional | DependencyPreviewSlotConfig |
TypeScript declaration
/** Slots for dependency links. Delivered via context. */
export declare interface GanttDependenciesSlots {
links?: DependencyLinksSlotConfig;
preview?: DependencyPreviewSlotConfig;
}Slots for the calendar/grid timeline chrome. Delivered via context.
| Property | Type & description |
|---|---|
markerOptional | MarkerSlotConfig |
calendarRowOptional | CalendarRowSlotConfig |
gridColumnOptional | GridColumnsSlotConfig |
gridOptional | GridSlotConfig |
gridResizeHandleOptional | GridResizeHandleSlotConfig |
TypeScript declaration
/** Slots for the calendar/grid timeline chrome. Delivered via context. */
export declare interface GanttTimelineSlots {
marker?: MarkerSlotConfig;
calendarRow?: CalendarRowSlotConfig;
gridColumn?: GridColumnsSlotConfig;
grid?: GridSlotConfig;
gridResizeHandle?: GridResizeHandleSlotConfig;
}SlotConfig
TypeConvenience shape for a component's public `{ slots, slotProps }` config prop.
| Property | Type & description |
|---|---|
slotsOptional | Slots |
slotPropsOptional | SlotProps |
TypeScript declaration
/** Convenience shape for a component's public `{ slots, slotProps }` config prop. */
export declare interface SlotConfig<Slots, SlotProps> {
slots?: Slots;
slotProps?: SlotProps;
}SlotPropsInput
TypeA consumer-supplied `slotProps` value for a single slot: either a props object, or a function of the component's `ownerState` returning props. `P` is the target element's prop type. Per-slot we pass the native element props (e.g. `ComponentProps<"button">`) so consumers get `className` / `onClick` / aria / `data-*` autocomplete. If a consumer replaces the element with a custom component via `slots`, the props stay loosely typed against the native shape (MUI's default).
/**
* A consumer-supplied `slotProps` value for a single slot: either a props object,
* or a function of the component's `ownerState` returning props.
*
* `P` is the target element's prop type. Per-slot we pass the native element props
* (e.g. `ComponentProps<"button">`) so consumers get `className` / `onClick` / aria /
* `data-*` autocomplete. If a consumer replaces the element with a custom component
* via `slots`, the props stay loosely typed against the native shape (MUI's default).
*/
export declare type SlotPropsInput<P, OwnerState> = Partial<P> | ((ownerState: OwnerState) => Partial<P>);mergeSlotProps
FunctionMerge library-owned internal props with a consumer's `slotProps` for one slot. - `className`: `clsx(internal, external)` — both apply, the consumer's comes last. - `style`: shallow-merged, the consumer wins per key. - all other props: the consumer overrides the internal value (MUI semantics — e.g. passing `onClick` replaces the default handler; this is the consumer's responsibility to preserve behavior).
/**
* Merge library-owned internal props with a consumer's `slotProps` for one slot.
*
* - `className`: `clsx(internal, external)` — both apply, the consumer's comes last.
* - `style`: shallow-merged, the consumer wins per key.
* - all other props: the consumer overrides the internal value (MUI semantics — e.g.
* passing `onClick` replaces the default handler; this is the consumer's
* responsibility to preserve behavior).
*/
export declare function mergeSlotProps<Props extends {
className?: string;
style?: CSSProperties;
}, OwnerState>(internalProps: Props, slotProps: SlotPropsInput<Props, OwnerState> | undefined, ownerState: OwnerState): Props;State passed to the function form of each BarProgress slotProps.
| Property | Type & description |
|---|---|
progressRequired | number |
widthRequired | number |
heightRequired | number |
TypeScript declaration
/** State passed to the function form of each BarProgress slotProps. */
export declare interface BarProgressOwnerState {
progress: number;
width: number;
height: number;
}State passed to the function form of the BarProgressResizeHandle slotProps.
| Property | Type & description |
|---|---|
widthRequired | number |
parentWidthRequired | number |
TypeScript declaration
/** State passed to the function form of the BarProgressResizeHandle slotProps. */
export declare interface BarProgressResizeHandleOwnerState {
width: number;
parentWidth: number;
}export declare type BarProgressResizeHandleSlotConfig = SlotConfig<BarProgressResizeHandleSlots, BarProgressResizeHandleSlotProps>;| Property | Type & description |
|---|---|
rootOptional | SlotPropsInput<ComponentProps<"div">, BarProgressResizeHandleOwnerState> |
TypeScript declaration
export declare interface BarProgressResizeHandleSlotProps {
root?: SlotPropsInput<ComponentProps<"div">, BarProgressResizeHandleOwnerState>;
}| Property | Type & description |
|---|---|
rootOptional | ElementTypeThe progress resize handle element. Default: `"div"`. |
TypeScript declaration
export declare interface BarProgressResizeHandleSlots {
/** The progress resize handle element. Default: `"div"`. */
root?: ElementType;
}Slot config for the bar progress fill.
/** Slot config for the bar progress fill. */
export declare type BarProgressSlotConfig = SlotConfig<BarProgressSlots, BarProgressSlotProps>;| Property | Type & description |
|---|---|
rootOptional | SlotPropsInput<ComponentProps<"div">, BarProgressOwnerState> |
TypeScript declaration
export declare interface BarProgressSlotProps {
root?: SlotPropsInput<ComponentProps<"div">, BarProgressOwnerState>;
}BarProgressSlots
Type| Property | Type & description |
|---|---|
rootOptional | ElementTypeThe progress fill element. Default: `"div"`. |
TypeScript declaration
export declare interface BarProgressSlots {
/** The progress fill element. Default: `"div"`. */
root?: ElementType;
}State passed to the function form of the tooltip slotProps, and to the slot component itself. `displayEnd` is resolved by `Row` rather than left to the consumer because `task.endDate` is an *exclusive* instant (ADR-014): a Mon–Fri task stores Saturday midnight, so rendering it raw reads as ending on Saturday. Handing over the already-inclusive date is what stops every tooltip from reintroducing that bug.
| Property | Type & description |
|---|---|
taskRequired | GanttTask |
progressRequired | numberResolved progress, override-aware during a drag — not `task.progress`. |
displayEndRequired | Date | undefinedInclusive, user-facing end date. `undefined` for an instant (a milestone). |
childrenOptional | ReactNodeThe bar itself. The slot is a *wrapper*: it has to render this, and has to decide for itself when to show a popup beside it — there is no `open` prop, because the chart holds no open state (ADR-022). Use `BarTooltipRoot` + `BarTooltipTrigger` for the built-in hover behaviour, or a third-party tooltip's own root and trigger. |
TypeScript declaration
/**
* State passed to the function form of the tooltip slotProps, and to the slot
* component itself.
*
* `displayEnd` is resolved by `Row` rather than left to the consumer because
* `task.endDate` is an *exclusive* instant (ADR-014): a Mon–Fri task stores
* Saturday midnight, so rendering it raw reads as ending on Saturday. Handing
* over the already-inclusive date is what stops every tooltip from reintroducing
* that bug.
*/
export declare interface BarTooltipOwnerState {
task: GanttTask;
/** Resolved progress, override-aware during a drag — not `task.progress`. */
progress: number;
/** Inclusive, user-facing end date. `undefined` for an instant (a milestone). */
displayEnd: Date | undefined;
/**
* The bar itself. The slot is a *wrapper*: it has to render this, and has to
* decide for itself when to show a popup beside it — there is no `open` prop,
* because the chart holds no open state (ADR-022). Use `BarTooltipRoot` +
* `BarTooltipTrigger` for the built-in hover behaviour, or a third-party
* tooltip's own root and trigger.
*/
children?: ReactNode;
}Slot config for the bar tooltip.
/** Slot config for the bar tooltip. */
export declare type BarTooltipSlotConfig = SlotConfig<BarTooltipSlots, BarTooltipSlotProps>;| Property | Type & description |
|---|---|
tooltipOptional | SlotPropsInput<ComponentProps<"div">, BarTooltipOwnerState> |
TypeScript declaration
export declare interface BarTooltipSlotProps {
tooltip?: SlotPropsInput<ComponentProps<"div">, BarTooltipOwnerState>;
}BarTooltipSlots
Type| Property | Type & description |
|---|---|
tooltipOptional | ElementTypeThe tooltip. Default: none — nothing is rendered and the bar keeps its native `title`. Pass `GanttBarTooltip` for the built-in one, or any component accepting BarTooltipProps. |
TypeScript declaration
export declare interface BarTooltipSlots {
/**
* The tooltip. Default: none — nothing is rendered and the bar keeps its
* native `title`. Pass `GanttBarTooltip` for the built-in one, or any component
* accepting {@link BarTooltipProps}.
*/
tooltip?: ElementType;
}| Property | Type & description |
|---|---|
taskRequired | GanttTask |
baselineRequired | GanttBaseline |
indexRequired | number |
leftRequired | number |
widthRequired | number |
displayEndOptional | Date |
TypeScript declaration
export declare interface BaselineOwnerState {
task: GanttTask;
baseline: GanttBaseline;
index: number;
left: number;
width: number;
displayEnd?: Date;
}export declare type BaselineSlotConfig = SlotConfig<BaselineSlots, BaselineSlotProps>;| Property | Type & description |
|---|---|
rootOptional | SlotPropsInput<ComponentProps<"div">, BaselineOwnerState> |
TypeScript declaration
export declare interface BaselineSlotProps {
root?: SlotPropsInput<ComponentProps<"div">, BaselineOwnerState>;
}BaselineSlots
Type| Property | Type & description |
|---|---|
rootOptional | ElementTypeVisual root. |
tooltipOptional | ElementTypeOptional wrapper for a custom tooltip; receives the baseline data and root as `children`. |
TypeScript declaration
export declare interface BaselineSlots {
/** Visual root. */
root?: ElementType;
/** Optional wrapper for a custom tooltip; receives the baseline data and root as `children`. */
tooltip?: ElementType;
}| Property | Type & description |
|---|---|
taskRequired | GanttTask |
baselineRequired | GanttBaseline |
indexRequired | number |
leftRequired | number |
widthRequired | number |
displayEndOptional | Date |
childrenRequired | ReactNode |
TypeScript declaration
export declare interface BaselineTooltipProps extends BaselineOwnerState {
children: ReactNode;
}Bounds
TypeAxis-aligned pixel bounds.
| Property | Type & description |
|---|---|
minXRequired | number |
minYRequired | number |
maxXRequired | number |
maxYRequired | number |
TypeScript declaration
/** Axis-aligned pixel bounds. */
export declare interface Bounds {
minX: number;
minY: number;
maxX: number;
maxY: number;
}State passed to the function form of the CalendarRow `cell` slotProps (per group).
| Property | Type & description |
|---|---|
scaleRequired | Scale |
dateRequired | DateStart date of the group this cell represents. |
startIndexRequired | numberIndex of the group's first date column. |
countRequired | numberNumber of date columns the group spans. |
isNonWorkingRequired | booleanWhether the calendar excludes this cell from working time. Prefer this over CalendarCellOwnerState.isWeekend — it also covers holidays. |
nonWorkingReasonOptional | NonWorkingReasonWhy the cell is non-working, for styling weekends and holidays apart. |
isWeekendRequired | boolean |
colWidthRequired | number |
TypeScript declaration
/** State passed to the function form of the CalendarRow `cell` slotProps (per group). */
export declare interface CalendarCellOwnerState {
scale: Scale;
/** Start date of the group this cell represents. */
date: Date;
/** Index of the group's first date column. */
startIndex: number;
/** Number of date columns the group spans. */
count: number;
/**
* Whether the calendar excludes this cell from working time. Prefer this over
* {@link CalendarCellOwnerState.isWeekend} — it also covers holidays.
*/
isNonWorking: boolean;
/** Why the cell is non-working, for styling weekends and holidays apart. */
nonWorkingReason?: NonWorkingReason;
/**
* @deprecated Use {@link CalendarCellOwnerState.isNonWorking}. Retained as an
* alias so existing slot code keeps working.
*/
isWeekend: boolean;
colWidth: number;
}State passed to the function form of the CalendarRow `row` slotProps.
| Property | Type & description |
|---|---|
scaleRequired | Scale |
colWidthRequired | number |
rowHeightRequired | number |
highlightWeekendsRequired | boolean |
TypeScript declaration
/** State passed to the function form of the CalendarRow `row` slotProps. */
export declare interface CalendarRowOwnerState {
scale: Scale;
colWidth: number;
rowHeight: number;
highlightWeekends: boolean;
}Slot config for a calendar (header) row. Pass via the calendar's slot props. NOTE: pass a referentially stable / memoized object so downstream memoization is not defeated by a fresh object each render.
/**
* Slot config for a calendar (header) row. Pass via the calendar's slot props.
*
* NOTE: pass a referentially stable / memoized object so downstream memoization
* is not defeated by a fresh object each render.
*/
export declare type CalendarRowSlotConfig = SlotConfig<CalendarRowSlots, CalendarRowSlotProps>;| Property | Type & description |
|---|---|
rowOptional | SlotPropsInput<ComponentProps<"div">, CalendarRowOwnerState> |
cellOptional | SlotPropsInput<ComponentProps<"div">, CalendarCellOwnerState> |
TypeScript declaration
export declare interface CalendarRowSlotProps {
row?: SlotPropsInput<ComponentProps<"div">, CalendarRowOwnerState>;
cell?: SlotPropsInput<ComponentProps<"div">, CalendarCellOwnerState>;
}CalendarRowSlots
Type| Property | Type & description |
|---|---|
rowOptional | ElementTypeThe row container. Default: `"div"`. |
cellOptional | ElementTypeA per-group header cell. Default: `"div"`. |
TypeScript declaration
export declare interface CalendarRowSlots {
/** The row container. Default: `"div"`. */
row?: ElementType;
/** A per-group header cell. Default: `"div"`. */
cell?: ElementType;
}State passed to the function form of each ConnectorHandles slotProps.
| Property | Type & description |
|---|---|
taskIdRequired | Id |
barLeftRequired | number |
barWidthRequired | number |
barCenterYRequired | number |
showRequired | boolean |
isDraggingRequired | boolean |
TypeScript declaration
/** State passed to the function form of each ConnectorHandles slotProps. */
export declare interface ConnectorHandlesOwnerState {
taskId: Id;
barLeft: number;
barWidth: number;
barCenterY: number;
show: boolean;
isDragging: boolean;
}export declare type ConnectorHandlesSlotConfig = SlotConfig<ConnectorHandlesSlots, ConnectorHandlesSlotProps>;| Property | Type & description |
|---|---|
startHandleOptional | SlotPropsInput<ComponentProps<"div">, ConnectorHandlesOwnerState> |
endHandleOptional | SlotPropsInput<ComponentProps<"div">, ConnectorHandlesOwnerState> |
TypeScript declaration
export declare interface ConnectorHandlesSlotProps {
startHandle?: SlotPropsInput<ComponentProps<"div">, ConnectorHandlesOwnerState>;
endHandle?: SlotPropsInput<ComponentProps<"div">, ConnectorHandlesOwnerState>;
}| Property | Type & description |
|---|---|
startHandleOptional | ElementTypeThe left/start dependency-connector handle. Default: `"div"`. |
endHandleOptional | ElementTypeThe right/end dependency-connector handle. Default: `"div"`. |
TypeScript declaration
export declare interface ConnectorHandlesSlots {
/** The left/start dependency-connector handle. Default: `"div"`. */
startHandle?: ElementType;
/** The right/end dependency-connector handle. Default: `"div"`. */
endHandle?: ElementType;
}State passed to the `deleteButton` slotProps.
| Property | Type & description |
|---|---|
dependencyRequired | TaskDependencyThe dependency the button will delete when clicked. |
TypeScript declaration
/** State passed to the `deleteButton` slotProps. */
export declare interface DependencyDeleteButtonOwnerState {
/** The dependency the button will delete when clicked. */
dependency: TaskDependency;
}State passed to the `lagLabel` slotProps.
| Property | Type & description |
|---|---|
linkRequired | DependencyLinkThe dependency link being rendered. |
isSelectedRequired | booleanWhether this link is currently selected. |
isCriticalRequired | booleanWhether this link is the binding edge of the critical path (ADR-023). |
lagRequired | numberThe lag value in days (non-zero when the label renders). |
TypeScript declaration
/** State passed to the `lagLabel` slotProps. */
export declare interface DependencyLagLabelOwnerState extends DependencyLinkOwnerState {
/** The lag value in days (non-zero when the label renders). */
lag: number;
}DependencyLink
Type| Property | Type & description |
|---|---|
idRequired | stringStable key, e.g. `"1->2"`. |
typeRequired | TaskDependencyType |
pointsRequired | Point[]Orthogonal polyline from the source edge to the target edge. |
boundsRequired | BoundsBounding box of DependencyLink.points, precomputed for culling. |
depRequired | TaskDependencyThe original dependency for callbacks. |
TypeScript declaration
export declare interface DependencyLink {
/** Stable key, e.g. `"1->2"`. */
id: string;
type: TaskDependencyType;
/** Orthogonal polyline from the source edge to the target edge. */
points: Point[];
/** Bounding box of {@link DependencyLink.points}, precomputed for culling. */
bounds: Bounds;
/** The original dependency for callbacks. */
dep: TaskDependency;
}State shared by the per-link slots (`arrow`).
| Property | Type & description |
|---|---|
linkRequired | DependencyLinkThe dependency link being rendered. |
isSelectedRequired | booleanWhether this link is currently selected. |
isCriticalRequired | booleanWhether this link is the binding edge of the critical path (ADR-023). |
TypeScript declaration
/** State shared by the per-link slots (`arrow`). */
export declare interface DependencyLinkOwnerState {
/** The dependency link being rendered. */
link: DependencyLink;
/** Whether this link is currently selected. */
isSelected: boolean;
/** Whether this link is the binding edge of the critical path (ADR-023). */
isCritical: boolean;
}State passed to the function form of the `layer` slotProps.
| Property | Type & description |
|---|---|
widthRequired | number |
heightRequired | number |
linkCountRequired | numberNumber of dependency links currently in the layer. |
TypeScript declaration
/** State passed to the function form of the `layer` slotProps. */
export declare interface DependencyLinksLayerOwnerState {
width: number;
height: number;
/** Number of dependency links currently in the layer. */
linkCount: number;
}Slot config for the dependency links layer.
/** Slot config for the dependency links layer. */
export declare type DependencyLinksSlotConfig = SlotConfig<DependencyLinksSlots, DependencyLinksSlotProps>;| Property | Type & description |
|---|---|
layerOptional | SlotPropsInput<ComponentProps<"div">, DependencyLinksLayerOwnerState> |
segmentOptional | SlotPropsInput<ComponentProps<"div">, DependencySegmentOwnerState> |
arrowOptional | SlotPropsInput<ComponentProps<"div">, DependencyLinkOwnerState> |
lagLabelOptional | SlotPropsInput<ComponentProps<"div">, DependencyLagLabelOwnerState> |
deleteButtonOptional | SlotPropsInput<ComponentProps<"button">, DependencyDeleteButtonOwnerState> |
TypeScript declaration
export declare interface DependencyLinksSlotProps {
layer?: SlotPropsInput<ComponentProps<"div">, DependencyLinksLayerOwnerState>;
segment?: SlotPropsInput<ComponentProps<"div">, DependencySegmentOwnerState>;
arrow?: SlotPropsInput<ComponentProps<"div">, DependencyLinkOwnerState>;
lagLabel?: SlotPropsInput<ComponentProps<"div">, DependencyLagLabelOwnerState>;
deleteButton?: SlotPropsInput<ComponentProps<"button">, DependencyDeleteButtonOwnerState>;
}| Property | Type & description |
|---|---|
layerOptional | ElementTypeThe absolutely-positioned links layer container. Default: `"div"`. |
segmentOptional | ElementTypeA single visible link segment. Default: `"div"`. |
arrowOptional | ElementTypeThe arrowhead at the target end of a link. Default: `"div"`. |
lagLabelOptional | ElementTypeThe `+Nd` / `-Nd` lag label. Default: `"div"`. |
deleteButtonOptional | ElementTypeThe `×` delete button shown for the selected link. Default: `"button"`. |
TypeScript declaration
export declare interface DependencyLinksSlots {
/** The absolutely-positioned links layer container. Default: `"div"`. */
layer?: ElementType;
/** A single visible link segment. Default: `"div"`. */
segment?: ElementType;
/** The arrowhead at the target end of a link. Default: `"div"`. */
arrow?: ElementType;
/** The `+Nd` / `-Nd` lag label. Default: `"div"`. */
lagLabel?: ElementType;
/** The `×` delete button shown for the selected link. Default: `"button"`. */
deleteButton?: ElementType;
}State passed to the function form of the `root` slotProps.
| Property | Type & description |
|---|---|
dragRequired | DependencyDragStateThe in-progress dependency drag. |
lengthRequired | numberHorizontal length of the rubber-band, in pixels. |
angleRequired | numberRotation of the rubber-band, in degrees. |
TypeScript declaration
/** State passed to the function form of the `root` slotProps. */
export declare interface DependencyPreviewOwnerState {
/** The in-progress dependency drag. */
drag: DependencyDragState;
/** Horizontal length of the rubber-band, in pixels. */
length: number;
/** Rotation of the rubber-band, in degrees. */
angle: number;
}Supporting types
These types appear in this signature but are not separate package exports.
declare interface DependencyDragState {
fromTaskId: Id;
handle: ConnectorHandle;
startX: number;
startY: number;
currentX: number;
currentY: number;
}
declare type ConnectorHandle = "start" | "end";Slot config for the dependency drag preview.
/** Slot config for the dependency drag preview. */
export declare type DependencyPreviewSlotConfig = SlotConfig<DependencyPreviewSlots, DependencyPreviewSlotProps>;| Property | Type & description |
|---|---|
rootOptional | SlotPropsInput<ComponentProps<"div">, DependencyPreviewOwnerState> |
TypeScript declaration
export declare interface DependencyPreviewSlotProps {
root?: SlotPropsInput<ComponentProps<"div">, DependencyPreviewOwnerState>;
}| Property | Type & description |
|---|---|
rootOptional | ElementTypeThe rubber-band preview line. Default: `"div"`. |
TypeScript declaration
export declare interface DependencyPreviewSlots {
/** The rubber-band preview line. Default: `"div"`. */
root?: ElementType;
}State passed to the `segment` slotProps, per visible segment of a link.
| Property | Type & description |
|---|---|
linkRequired | DependencyLinkThe dependency link being rendered. |
isSelectedRequired | booleanWhether this link is currently selected. |
isCriticalRequired | booleanWhether this link is the binding edge of the critical path (ADR-023). |
fromRequired | PointStart point of this segment. |
toRequired | PointEnd point of this segment. |
indexRequired | numberIndex of this segment within the link's polyline. |
TypeScript declaration
/** State passed to the `segment` slotProps, per visible segment of a link. */
export declare interface DependencySegmentOwnerState extends DependencyLinkOwnerState {
/** Start point of this segment. */
from: Point;
/** End point of this segment. */
to: Point;
/** Index of this segment within the link's polyline. */
index: number;
}State passed to the function form of the GridColumns `column` slotProps (per day).
| Property | Type & description |
|---|---|
dateRequired | DateThe day this column paints. |
indexRequired | numberAbsolute date-column index. |
isNonWorkingRequired | booleanWhether the calendar excludes this column from working time. Prefer this over GridColumnOwnerState.isWeekend — it also covers holidays and, at hour scale, off-hours. |
nonWorkingReasonOptional | NonWorkingReasonWhy the column is non-working, for styling weekends and holidays apart. |
isWeekendRequired | boolean |
colWidthRequired | number |
bodyHeightRequired | number |
TypeScript declaration
/** State passed to the function form of the GridColumns `column` slotProps (per day). */
export declare interface GridColumnOwnerState {
/** The day this column paints. */
date: Date;
/** Absolute date-column index. */
index: number;
/**
* Whether the calendar excludes this column from working time. Prefer this over
* {@link GridColumnOwnerState.isWeekend} — it also covers holidays and, at hour
* scale, off-hours.
*/
isNonWorking: boolean;
/** Why the column is non-working, for styling weekends and holidays apart. */
nonWorkingReason?: NonWorkingReason;
/**
* @deprecated Use {@link GridColumnOwnerState.isNonWorking}. Retained as an
* alias so existing slot code keeps working; it is now true for any
* non-working column, not only Saturday and Sunday.
*/
isWeekend: boolean;
colWidth: number;
bodyHeight: number;
}Slot config for the grid background columns. Pass via the grid's slot props. NOTE: pass a referentially stable / memoized object so downstream memoization is not defeated by a fresh object each render.
/**
* Slot config for the grid background columns. Pass via the grid's slot props.
*
* NOTE: pass a referentially stable / memoized object so downstream memoization
* is not defeated by a fresh object each render.
*/
export declare type GridColumnsSlotConfig = SlotConfig<GridColumnsSlots, GridColumnsSlotProps>;| Property | Type & description |
|---|---|
columnOptional | SlotPropsInput<ComponentProps<"div">, GridColumnOwnerState> |
TypeScript declaration
export declare interface GridColumnsSlotProps {
column?: SlotPropsInput<ComponentProps<"div">, GridColumnOwnerState>;
}GridColumnsSlots
Type| Property | Type & description |
|---|---|
columnOptional | ElementTypeA per-day background column. Default: `"div"`. |
TypeScript declaration
export declare interface GridColumnsSlots {
/** A per-day background column. Default: `"div"`. */
column?: ElementType;
}GridOwnerState
TypeState passed to the function form of the Grid slotProps.
| Property | Type & description |
|---|---|
totalWidthRequired | numberTotal content width in px (`dates.length * colWidth`). |
bodyHeightRequired | numberTotal body height in px (`visibleTasks.length * rowHeight`). |
heightRequired | number | undefinedFixed grid-wrapper height when configured, else `undefined` (auto). |
TypeScript declaration
/** State passed to the function form of the Grid slotProps. */
export declare interface GridOwnerState {
/** Total content width in px (`dates.length * colWidth`). */
totalWidth: number;
/** Total body height in px (`visibleTasks.length * rowHeight`). */
bodyHeight: number;
/** Fixed grid-wrapper height when configured, else `undefined` (auto). */
height: number | undefined;
}State passed to the function form of the GridResizeHandle slotProps.
| Property | Type & description |
|---|---|
isResizingRequired | booleanWhether a resize drag is currently in progress. |
TypeScript declaration
/** State passed to the function form of the GridResizeHandle slotProps. */
export declare interface GridResizeHandleOwnerState {
/** Whether a resize drag is currently in progress. */
isResizing: boolean;
}export declare type GridResizeHandleSlotConfig = SlotConfig<GridResizeHandleSlots, GridResizeHandleSlotProps>;| Property | Type & description |
|---|---|
rootOptional | SlotPropsInput<ComponentProps<"div">, GridResizeHandleOwnerState> |
TypeScript declaration
export declare interface GridResizeHandleSlotProps {
root?: SlotPropsInput<ComponentProps<"div">, GridResizeHandleOwnerState>;
}| Property | Type & description |
|---|---|
rootOptional | ElementTypeThe pane splitter element. Default: `"div"`. |
TypeScript declaration
export declare interface GridResizeHandleSlots {
/** The pane splitter element. Default: `"div"`. */
root?: ElementType;
}GridSlotConfig
TypeSlot config for the Gantt grid. Threaded from `<Gantt>` in a later pass. NOTE: pass a referentially stable / memoized object so downstream memoization is not defeated by a fresh object each render.
/**
* Slot config for the Gantt grid. Threaded from `<Gantt>` in a later pass.
*
* NOTE: pass a referentially stable / memoized object so downstream memoization
* is not defeated by a fresh object each render.
*/
export declare type GridSlotConfig = SlotConfig<GridSlots, GridSlotProps>;GridSlotProps
Type| Property | Type & description |
|---|---|
rootOptional | SlotPropsInput<ComponentProps<"div">, GridOwnerState> |
bodyOptional | SlotPropsInput<ComponentProps<"div">, GridOwnerState> |
TypeScript declaration
export declare interface GridSlotProps {
root?: SlotPropsInput<ComponentProps<"div">, GridOwnerState>;
body?: SlotPropsInput<ComponentProps<"div">, GridOwnerState>;
}GridSlots
Type| Property | Type & description |
|---|---|
rootOptional | ElementTypeThe scroll wrapper (`styles.gridWrapper`). Default: `"div"`. |
bodyOptional | ElementTypeThe scrollable body layer (`styles.body`). Default: `"div"`. |
TypeScript declaration
export declare interface GridSlots {
/** The scroll wrapper (`styles.gridWrapper`). Default: `"div"`. */
root?: ElementType;
/** The scrollable body layer (`styles.body`). Default: `"div"`. */
body?: ElementType;
}MarkerOwnerState
Type| Property | Type & description |
|---|---|
dateRequired | Date |
titleOptional | string |
visibleTopRequired | number |
TypeScript declaration
export declare interface MarkerOwnerState {
date: Date;
title?: string;
visibleTop: number;
}MarkerSlotConfig
Typeexport declare type MarkerSlotConfig = SlotConfig<MarkerSlots, MarkerSlotProps>;MarkerSlotProps
Type| Property | Type & description |
|---|---|
rootOptional | SlotPropsInput<ComponentProps<"div">, MarkerOwnerState> |
lineOptional | SlotPropsInput<ComponentProps<"div">, MarkerOwnerState> |
labelOptional | SlotPropsInput<ComponentProps<"span">, MarkerOwnerState> |
TypeScript declaration
export declare interface MarkerSlotProps {
root?: SlotPropsInput<ComponentProps<"div">, MarkerOwnerState>;
line?: SlotPropsInput<ComponentProps<"div">, MarkerOwnerState>;
label?: SlotPropsInput<ComponentProps<"span">, MarkerOwnerState>;
}MarkerSlots
Type| Property | Type & description |
|---|---|
rootOptional | ElementType |
lineOptional | ElementType |
labelOptional | ElementType |
TypeScript declaration
export declare interface MarkerSlots {
root?: ElementType;
line?: ElementType;
label?: ElementType;
}| Property | Type & description |
|---|---|
sizeRequired | number |
titleRequired | string |
isCriticalRequired | booleanWhether this bar is on the critical path (ADR-023). |
TypeScript declaration
export declare interface MilestoneBarOwnerState {
size: number;
title: string;
/** Whether this bar is on the critical path (ADR-023). */
isCritical: boolean;
}export declare type MilestoneBarSlotConfig = SlotConfig<MilestoneBarSlots, MilestoneBarSlotProps>;| Property | Type & description |
|---|---|
rootOptional | SlotPropsInput<ComponentProps<"div">, MilestoneBarOwnerState> |
shapeOptional | SlotPropsInput<ComponentProps<"div">, MilestoneBarOwnerState> |
TypeScript declaration
export declare interface MilestoneBarSlotProps {
root?: SlotPropsInput<ComponentProps<"div">, MilestoneBarOwnerState>;
shape?: SlotPropsInput<ComponentProps<"div">, MilestoneBarOwnerState>;
}| Property | Type & description |
|---|---|
rootOptional | ElementTypeThe draggable bar wrapper. Default: `DraggableBar`. |
shapeOptional | ElementTypeThe diamond shape. Default: `"div"`. |
TypeScript declaration
export declare interface MilestoneBarSlots {
/** The draggable bar wrapper. Default: `DraggableBar`. */
root?: ElementType;
/** The diamond shape. Default: `"div"`. */
shape?: ElementType;
}Point
Type| Property | Type & description |
|---|---|
xRequired | number |
yRequired | number |
TypeScript declaration
export declare interface Point {
x: number;
y: number;
}State passed to the function form of each ProjectBar slotProps.
| Property | Type & description |
|---|---|
widthRequired | number |
heightRequired | number |
progressRequired | number |
titleRequired | string |
isCriticalRequired | booleanWhether this bar is on the critical path (ADR-023). |
TypeScript declaration
/** State passed to the function form of each ProjectBar slotProps. */
export declare interface ProjectBarOwnerState {
width: number;
height: number;
progress: number;
title: string;
/** Whether this bar is on the critical path (ADR-023). */
isCritical: boolean;
}Slot config for the project bar.
/** Slot config for the project bar. */
export declare type ProjectBarSlotConfig = SlotConfig<ProjectBarSlots, ProjectBarSlotProps>;| Property | Type & description |
|---|---|
rootOptional | SlotPropsInput<ComponentProps<"div">, ProjectBarOwnerState> |
innerOptional | SlotPropsInput<ComponentProps<"div">, ProjectBarOwnerState> |
labelOptional | SlotPropsInput<ComponentProps<"div">, ProjectBarOwnerState> |
TypeScript declaration
export declare interface ProjectBarSlotProps {
root?: SlotPropsInput<ComponentProps<"div">, ProjectBarOwnerState>;
inner?: SlotPropsInput<ComponentProps<"div">, ProjectBarOwnerState>;
label?: SlotPropsInput<ComponentProps<"div">, ProjectBarOwnerState>;
}ProjectBarSlots
Type| Property | Type & description |
|---|---|
rootOptional | ElementTypeThe draggable bar wrapper. Default: `DraggableBar`. |
innerOptional | ElementTypeThe inner layout wrapper holding progress/label. Default: `"div"`. |
labelOptional | ElementTypeThe title label. Default: `"div"`. |
TypeScript declaration
export declare interface ProjectBarSlots {
/** The draggable bar wrapper. Default: `DraggableBar`. */
root?: ElementType;
/** The inner layout wrapper holding progress/label. Default: `"div"`. */
inner?: ElementType;
/** The title label. Default: `"div"`. */
label?: ElementType;
}State passed to the function form of each TaskBar slotProps.
| Property | Type & description |
|---|---|
widthRequired | number |
heightRequired | number |
progressRequired | number |
titleRequired | string |
isCriticalRequired | booleanWhether this bar is on the critical path (ADR-023). |
TypeScript declaration
/** State passed to the function form of each TaskBar slotProps. */
export declare interface TaskBarOwnerState {
width: number;
height: number;
progress: number;
title: string;
/** Whether this bar is on the critical path (ADR-023). */
isCritical: boolean;
}Slot config for the task bar.
/** Slot config for the task bar. */
export declare type TaskBarSlotConfig = SlotConfig<TaskBarSlots, TaskBarSlotProps>;TaskBarSlotProps
Type| Property | Type & description |
|---|---|
rootOptional | SlotPropsInput<ComponentProps<"div">, TaskBarOwnerState> |
innerOptional | SlotPropsInput<ComponentProps<"div">, TaskBarOwnerState> |
labelOptional | SlotPropsInput<ComponentProps<"div">, TaskBarOwnerState> |
TypeScript declaration
export declare interface TaskBarSlotProps {
root?: SlotPropsInput<ComponentProps<"div">, TaskBarOwnerState>;
inner?: SlotPropsInput<ComponentProps<"div">, TaskBarOwnerState>;
label?: SlotPropsInput<ComponentProps<"div">, TaskBarOwnerState>;
}TaskBarSlots
Type| Property | Type & description |
|---|---|
rootOptional | ElementTypeThe draggable bar wrapper. Default: `DraggableBar`. |
innerOptional | ElementTypeThe inner layout wrapper holding progress/label/resizer. Default: `"div"`. |
labelOptional | ElementTypeThe title label. Default: `"div"`. |
TypeScript declaration
export declare interface TaskBarSlots {
/** The draggable bar wrapper. Default: `DraggableBar`. */
root?: ElementType;
/** The inner layout wrapper holding progress/label/resizer. Default: `"div"`. */
inner?: ElementType;
/** The title label. Default: `"div"`. */
label?: ElementType;
}State passed to the function form of the per-column slotProps.
| Property | Type & description |
|---|---|
columnRequired | ColumnDef |
indexRequired | number |
TypeScript declaration
/** State passed to the function form of the per-column slotProps. */
export declare interface TaskListHeaderCellOwnerState {
column: ColumnDef;
index: number;
}State passed to the function form of the header (container) slotProps.
| Property | Type & description |
|---|---|
columnsRequired | ColumnDef[] |
headerHeightRequired | number |
TypeScript declaration
/** State passed to the function form of the header (container) slotProps. */
export declare interface TaskListHeaderOwnerState {
columns: ColumnDef[];
headerHeight: number;
}export declare type TaskListHeaderSlotConfig = SlotConfig<TaskListHeaderSlots, TaskListHeaderSlotProps>;| Property | Type & description |
|---|---|
headerOptional | SlotPropsInput<ComponentProps<"div">, TaskListHeaderOwnerState> |
headerCellOptional | SlotPropsInput<ComponentProps<"div">, TaskListHeaderCellOwnerState> |
columnResizeHandleOptional | SlotPropsInput<ComponentProps<"div">, TaskListHeaderCellOwnerState> |
TypeScript declaration
export declare interface TaskListHeaderSlotProps {
header?: SlotPropsInput<ComponentProps<"div">, TaskListHeaderOwnerState>;
headerCell?: SlotPropsInput<ComponentProps<"div">, TaskListHeaderCellOwnerState>;
columnResizeHandle?: SlotPropsInput<ComponentProps<"div">, TaskListHeaderCellOwnerState>;
}| Property | Type & description |
|---|---|
headerOptional | ElementTypeThe header row container. Default: `"div"`. |
headerCellOptional | ElementTypeA per-column header cell. Default: `"div"`. |
columnResizeHandleOptional | ElementTypeThe per-column resize handle (divider). Default: `"div"`. |
TypeScript declaration
export declare interface TaskListHeaderSlots {
/** The header row container. Default: `"div"`. */
header?: ElementType;
/** A per-column header cell. Default: `"div"`. */
headerCell?: ElementType;
/** The per-column resize handle (divider). Default: `"div"`. */
columnResizeHandle?: ElementType;
}State passed to the function form of each TaskResizer slotProps.
| Property | Type & description |
|---|---|
widthRequired | number |
leftRequired | number |
TypeScript declaration
/** State passed to the function form of each TaskResizer slotProps. */
export declare interface TaskResizerOwnerState {
width: number;
left: number;
}export declare type TaskResizerSlotConfig = SlotConfig<TaskResizerSlots, TaskResizerSlotProps>;| Property | Type & description |
|---|---|
startHandleOptional | SlotPropsInput<ComponentProps<"button">, TaskResizerOwnerState> |
endHandleOptional | SlotPropsInput<ComponentProps<"button">, TaskResizerOwnerState> |
TypeScript declaration
export declare interface TaskResizerSlotProps {
startHandle?: SlotPropsInput<ComponentProps<"button">, TaskResizerOwnerState>;
endHandle?: SlotPropsInput<ComponentProps<"button">, TaskResizerOwnerState>;
}TaskResizerSlots
Type| Property | Type & description |
|---|---|
startHandleOptional | ElementTypeThe left/start resize button. Default: `"button"`. |
endHandleOptional | ElementTypeThe right/end resize button. Default: `"button"`. |
TypeScript declaration
export declare interface TaskResizerSlots {
/** The left/start resize button. Default: `"button"`. */
startHandle?: ElementType;
/** The right/end resize button. Default: `"button"`. */
endHandle?: ElementType;
}State passed to the function form of each TreeCell slotProps.
| Property | Type & description |
|---|---|
taskIdRequired | Id |
depthRequired | number |
isParentRequired | boolean |
isExpandedRequired | boolean |
TypeScript declaration
/** State passed to the function form of each TreeCell slotProps. */
export declare interface TreeCellOwnerState {
taskId: Id;
depth: number;
isParent: boolean;
isExpanded: boolean;
}Slot config for the tree cell. Pass via `<Gantt treeCell={...} />`. NOTE: pass a referentially stable / memoized object — `TaskListRow` is memoized, so a fresh object each render defeats its memo and re-renders every row.
/**
* Slot config for the tree cell. Pass via `<Gantt treeCell={...} />`.
*
* NOTE: pass a referentially stable / memoized object — `TaskListRow` is memoized,
* so a fresh object each render defeats its memo and re-renders every row.
*/
export declare type TreeCellSlotConfig = SlotConfig<TreeCellSlots, TreeCellSlotProps>;| Property | Type & description |
|---|---|
rootOptional | SlotPropsInput<ComponentProps<"span">, TreeCellOwnerState> |
expandButtonOptional | SlotPropsInput<ComponentProps<"button">, TreeCellOwnerState> |
placeholderOptional | SlotPropsInput<ComponentProps<"span">, TreeCellOwnerState> |
TypeScript declaration
export declare interface TreeCellSlotProps {
root?: SlotPropsInput<ComponentProps<"span">, TreeCellOwnerState>;
expandButton?: SlotPropsInput<ComponentProps<"button">, TreeCellOwnerState>;
placeholder?: SlotPropsInput<ComponentProps<"span">, TreeCellOwnerState>;
}TreeCellSlots
Type| Property | Type & description |
|---|---|
rootOptional | ElementTypeThe `nameContent` wrapper. Default: `"span"`. |
expandButtonOptional | ElementTypeThe ▾/▸ expand/collapse toggle. Default: `"button"`. |
placeholderOptional | ElementTypeThe spacer rendered for leaf (non-parent) rows. Default: `"span"`. |
TypeScript declaration
export declare interface TreeCellSlots {
/** The `nameContent` wrapper. Default: `"span"`. */
root?: ElementType;
/** The ▾/▸ expand/collapse toggle. Default: `"button"`. */
expandButton?: ElementType;
/** The spacer rendered for leaf (non-parent) rows. Default: `"span"`. */
placeholder?: ElementType;
}