Introducing PrimeReact v11-alpha 🎉Discover Now

OrganizationChart API

API documentation for OrganizationChart component

OrganizationChartRoot#

Props#

Defines valid properties in OrganizationChart component.

PropDefaultType
ref—Ref<unknown>
The reference to the component instance.
pIftrueboolean
Whether the component should be rendered.
style—CSSProperties | ((instance?: OrganizationChartRootInstance) => CSSProperties)
The style to apply to the component.
className—string | ((instance?: OrganizationChartRootInstance) => string)
The class name to apply to the component.
as—string | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildfalseboolean
Whether the component should be rendered as a child component.
instance—OrganizationChartRootInstance
The instance to pass to the component.
pt—SafeRecord<OrganizationChartRootPassThrough>
The pass-through props to pass to the component.
ptOptions—PassThroughOptions
The pass-through options to pass to the component.
unstyled—boolean
Whether the component should be rendered without classes.
dt—unknown
The design token to use for the component.
styles—StylesOptions<ComponentInstance>
The styles to use for the component.
render—(instance: OrganizationChartRootInstance) => ReactNode
The render function to render the component with instance access.
children—any
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
value—TreeNode[]
The data of the org chart.
gap—number | number[]
The gap of the org chart.
selectabletrueboolean
Whether the nodes of the org chart are selectable.
collapsiblefalseboolean
Whether the nodes of the org chart are collapsible.
selectionMode—"multiple" | "single"
The selection mode of the org chart.
[key: string]—any
pt-{optionName}-*—-
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Defines valid state in OrganizationChart component.

PropType
selectedNodesstring[]
The selected nodes' ids of the org chart.
collapsedNodesstring[]
The collapsed nodes' ids of the org chart.

Exposes#

Defines the methods and properties exposed by OrganizationChart component.

PropType
rootPropsuseOrganizationChartRootProps
Pre-built props for the root element.
getTreeProps(node: TreeNode, level: number) => useOrganizationChartTreeProps
Returns pre-built props for a tree item element.
getNodeProps(node: TreeNode, handleClick: (event: MouseEvent<HTMLDivElement>) => void) => useOrganizationChartNodeProps
Returns pre-built props for a node element.
getCollapseButtonProps(node: TreeNode, handleClick: (event: MouseEvent<HTMLButtonElement>) => void) => useOrganizationChartCollapseButtonProps
Returns pre-built props for a collapse button element.
subtreePropsuseOrganizationChartSubtreeProps
Pre-built props for a subtree element.
toggleNodeSelect(key?: string) => void
Toggles the selection of a node.
toggleNodeCollapse(key?: string) => void
Toggles the collapse state of a node.
isCollapsible(node?: TreeNode) => boolean
Checks if a node is collapsible.
isCollapsed(node?: TreeNode) => boolean
Checks if a node is collapsed.
isSelected(node?: TreeNode) => boolean
Checks if a node is selected.
isSelectable(node?: TreeNode) => boolean
Checks if a node is selectable.
handleNodeKeyDown(event: KeyboardEvent<HTMLDivElement>, key?: string) => void
Handles the key down event of a node.
handleCollapseKeyDown(event: KeyboardEvent<HTMLButtonElement>, key?: string) => void
Handles the key down event of a collapse button.
orgChartStyle{ --px-gap-x: number; --px-gap-y: number }
CSS custom properties for the org chart layout (gap).
stateOrganizationChartRootState
The state of the OrganizationChart component.

Interfaces#

Defines passthrough(pt) options of OrganizationChart component.

PropType
rootOrganizationChartRootPassThroughType<HTMLAttributes<HTMLDivElement>>
Used to pass attributes to the root's DOM element.
nodeOrganizationChartRootPassThroughType<HTMLAttributes<HTMLDivElement>>
Used to pass attributes to the node's DOM element.
subtreeOrganizationChartRootPassThroughType<HTMLAttributes<HTMLUListElement>>
Used to pass attributes to the subtree's DOM element.
treeOrganizationChartRootPassThroughType<HTMLAttributes<HTMLLIElement>>
Used to pass attributes to the tree's DOM element.

Types#

Instance of OrganizationChart component.

Values
ComponentInstance<OrganizationChartRootProps, OrganizationChartRootState, OrganizationChartRootExposes>

OrganizationChartTree#

Props#

Defines valid properties in OrganizationChartTree component.

PropDefaultType
ref—Ref<unknown>
The reference to the component instance.
pIftrueboolean
Whether the component should be rendered.
style—CSSProperties | ((instance?: OrganizationChartTreeInstance) => CSSProperties)
The style to apply to the component.
className—string | ((instance?: OrganizationChartTreeInstance) => string)
The class name to apply to the component.
as—string | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildfalseboolean
Whether the component should be rendered as a child component.
instance—OrganizationChartTreeInstance
The instance to pass to the component.
pt—SafeRecord<OrganizationChartTreePassThrough>
The pass-through props to pass to the component.
ptOptions—PassThroughOptions
The pass-through options to pass to the component.
unstyled—boolean
Whether the component should be rendered without classes.
dt—unknown
The design token to use for the component.
styles—StylesOptions<ComponentInstance>
The styles to use for the component.
render—(instance: OrganizationChartTreeInstance) => ReactNode
The render function to render the component with instance access.
children—any
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
item—TreeNode
The item of the org chart tree.
[key: string]—any
pt-{optionName}-*—-
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by OrganizationChartTree component.

PropType
organizationchartOrganizationChartRootInstance
The parent OrganizationChart instance.
levelnumber
The level of the org chart tree.

Interfaces#

Defines passthrough(pt) options of OrganizationChartTree component.

PropType
rootOrganizationChartTreePassThroughType<HTMLAttributes<HTMLDivElement>>
Used to pass attributes to the root's DOM element.

Types#

Instance of OrganizationChartTree component.

Values
ComponentInstance<OrganizationChartTreeProps, OrganizationChartTreeState, OrganizationChartTreeExposes>

OrganizationChartSubtree#

Props#

Defines valid properties in OrganizationChartSubtree component.

PropDefaultType
ref—Ref<unknown>
The reference to the component instance.
pIftrueboolean
Whether the component should be rendered.
style—CSSProperties | ((instance?: OrganizationChartSubtreeInstance) => CSSProperties)
The style to apply to the component.
className—string | ((instance?: OrganizationChartSubtreeInstance) => string)
The class name to apply to the component.
as—string | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildfalseboolean
Whether the component should be rendered as a child component.
instance—OrganizationChartSubtreeInstance
The instance to pass to the component.
pt—SafeRecord<OrganizationChartSubtreePassThrough>
The pass-through props to pass to the component.
ptOptions—PassThroughOptions
The pass-through options to pass to the component.
unstyled—boolean
Whether the component should be rendered without classes.
dt—unknown
The design token to use for the component.
styles—StylesOptions<ComponentInstance>
The styles to use for the component.
render—(instance: OrganizationChartSubtreeInstance) => ReactNode
The render function to render the component with instance access.
children—any
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
items—TreeNode[]
The items of the org chart subtree.
root—boolean
Whether the org chart subtree is the root.
[key: string]—any
pt-{optionName}-*—-
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by OrganizationChartSubtree component.

PropType
organizationchartOrganizationChartRootInstance
The parent OrganizationChart instance.

Interfaces#

Defines passthrough(pt) options of OrganizationChartSubtree component.

PropType
rootOrganizationChartSubtreePassThroughType<HTMLAttributes<HTMLDivElement>>
Used to pass attributes to the root's DOM element.

Types#

Instance of OrganizationChartSubtree component.

Values
ComponentInstance<OrganizationChartSubtreeProps, OrganizationChartSubtreeState, OrganizationChartSubtreeExposes>

OrganizationChartNode#

Props#

Defines valid properties in OrganizationChartNode component.

PropDefaultType
ref—Ref<unknown>
The reference to the component instance.
pIftrueboolean
Whether the component should be rendered.
style—CSSProperties | ((instance?: OrganizationChartNodeInstance) => CSSProperties)
The style to apply to the component.
className—string | ((instance?: OrganizationChartNodeInstance) => string)
The class name to apply to the component.
as—string | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildfalseboolean
Whether the component should be rendered as a child component.
instance—OrganizationChartNodeInstance
The instance to pass to the component.
pt—SafeRecord<OrganizationChartNodePassThrough>
The pass-through props to pass to the component.
ptOptions—PassThroughOptions
The pass-through options to pass to the component.
unstyled—boolean
Whether the component should be rendered without classes.
dt—unknown
The design token to use for the component.
styles—StylesOptions<ComponentInstance>
The styles to use for the component.
render—(instance: OrganizationChartNodeInstance) => ReactNode
The render function to render the component with instance access.
children—any
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]—any
pt-{optionName}-*—-
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by OrganizationChartNode component.

PropType
organizationchartOrganizationChartRootInstance
The parent OrganizationChart instance.

Interfaces#

Defines passthrough(pt) options of OrganizationChartNode component.

PropType
rootOrganizationChartNodePassThroughType<HTMLAttributes<HTMLDivElement>>
Used to pass attributes to the root's DOM element.

Types#

Instance of OrganizationChartNode component.

Values
ComponentInstance<OrganizationChartNodeProps, OrganizationChartNodeState, OrganizationChartNodeExposes>

OrganizationChartNodeContent#

Props#

Defines valid properties in OrganizationChartNodeContent component.

PropDefaultType
ref—Ref<unknown>
The reference to the component instance.
pIftrueboolean
Whether the component should be rendered.
style—CSSProperties | ((instance?: OrganizationChartNodeContentInstance) => CSSProperties)
The style to apply to the component.
className—string | ((instance?: OrganizationChartNodeContentInstance) => string)
The class name to apply to the component.
as—string | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildfalseboolean
Whether the component should be rendered as a child component.
instance—OrganizationChartNodeContentInstance
The instance to pass to the component.
pt—SafeRecord<OrganizationChartNodeContentPassThrough>
The pass-through props to pass to the component.
ptOptions—PassThroughOptions
The pass-through options to pass to the component.
unstyled—boolean
Whether the component should be rendered without classes.
dt—unknown
The design token to use for the component.
styles—StylesOptions<ComponentInstance>
The styles to use for the component.
render—(instance: OrganizationChartNodeContentInstance) => ReactNode
The render function to render the component with instance access.
children—any
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]—any
pt-{optionName}-*—-
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by OrganizationChartNodeContent component.

PropType
organizationchartOrganizationChartRootInstance
The parent OrganizationChart instance.

Interfaces#

Defines passthrough(pt) options of OrganizationChartNodeContent component.

PropType
rootOrganizationChartNodeContentPassThroughType<HTMLAttributes<HTMLDivElement>>
Used to pass attributes to the root's DOM element.

Types#

Instance of OrganizationChartNodeContent component.

Values
ComponentInstance<OrganizationChartNodeContentProps, OrganizationChartNodeContentState, OrganizationChartNodeContentExposes>

OrganizationChartCollapseButton#

Props#

Defines valid properties in OrganizationChartCollapseButton component.

PropDefaultType
ref—Ref<unknown>
The reference to the component instance.
pIftrueboolean
Whether the component should be rendered.
style—CSSProperties | ((instance?: OrganizationChartCollapseButtonInstance) => CSSProperties)
The style to apply to the component.
className—string | ((instance?: OrganizationChartCollapseButtonInstance) => string)
The class name to apply to the component.
as—string | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
The component type to render.
asChildfalseboolean
Whether the component should be rendered as a child component.
instance—OrganizationChartCollapseButtonInstance
The instance to pass to the component.
pt—SafeRecord<OrganizationChartCollapseButtonPassThrough>
The pass-through props to pass to the component.
ptOptions—PassThroughOptions
The pass-through options to pass to the component.
unstyled—boolean
Whether the component should be rendered without classes.
dt—unknown
The design token to use for the component.
styles—StylesOptions<ComponentInstance>
The styles to use for the component.
render—(instance: OrganizationChartCollapseButtonInstance) => ReactNode
The render function to render the component with instance access.
children—any
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]—any
pt-{optionName}-*—-
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by OrganizationChartCollapseButton component.

PropType
organizationchartOrganizationChartRootInstance
The parent OrganizationChart instance.

Interfaces#

Defines passthrough(pt) options of OrganizationChartCollapseButton component.

PropType
rootOrganizationChartCollapseButtonPassThroughType<HTMLAttributes<HTMLDivElement>>
Used to pass attributes to the root's DOM element.

Types#

Instance of OrganizationChartCollapseButton component.

Values
ComponentInstance<OrganizationChartCollapseButtonProps, OrganizationChartCollapseButtonState, OrganizationChartCollapseButtonExposes>