Introducing PrimeReact v11-alpha 🎉Discover Now

OrgChart API

API documentation for OrgChart component

OrgChartRoot#

Props#

Defines valid properties in OrgChart component.

PropDefaultType
ref—Ref<unknown>
The reference to the component instance.
pIftrueboolean
Whether the component should be rendered.
style—CSSProperties | ((instance?: OrgChartRootInstance) => CSSProperties)
The style to apply to the component.
className—string | ((instance?: OrgChartRootInstance) => 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—OrgChartRootInstance
The instance to pass to the component.
pt—SafeRecord<OrgChartRootPassThrough>
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: OrgChartRootInstance) => 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 OrgChart 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 OrgChart component.

PropType
rootPropsuseOrgChartRootProps
Pre-built props for the root element.
getTreeProps(node: TreeNode, level: number) => useOrgChartTreeProps
Returns pre-built props for a tree item element.
getNodeProps(node: TreeNode, handleClick: (event: MouseEvent<HTMLDivElement>) => void) => useOrgChartNodeProps
Returns pre-built props for a node element.
getCollapseButtonProps(node: TreeNode, handleClick: (event: MouseEvent<HTMLButtonElement>) => void) => useOrgChartCollapseButtonProps
Returns pre-built props for a collapse button element.
subtreePropsuseOrgChartSubtreeProps
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{ --gap-x: number; --gap-y: number }
CSS custom properties for the org chart layout (gap).
stateOrgChartRootState
The state of the OrgChart component.

Interfaces#

Defines passthrough(pt) options of OrgChart component.

PropType
rootOrgChartRootPassThroughType<HTMLAttributes<HTMLDivElement>>
Used to pass attributes to the root's DOM element.
nodeOrgChartRootPassThroughType<HTMLAttributes<HTMLDivElement>>
Used to pass attributes to the node's DOM element.
subtreeOrgChartRootPassThroughType<HTMLAttributes<HTMLUListElement>>
Used to pass attributes to the subtree's DOM element.
treeOrgChartRootPassThroughType<HTMLAttributes<HTMLLIElement>>
Used to pass attributes to the tree's DOM element.

Types#

Instance of OrgChart component.

Values
ComponentInstance<OrgChartRootProps, OrgChartRootState, OrgChartRootExposes>

OrgChartTree#

Props#

Defines valid properties in OrgChartTree component.

PropDefaultType
ref—Ref<unknown>
The reference to the component instance.
pIftrueboolean
Whether the component should be rendered.
style—CSSProperties | ((instance?: OrgChartTreeInstance) => CSSProperties)
The style to apply to the component.
className—string | ((instance?: OrgChartTreeInstance) => 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—OrgChartTreeInstance
The instance to pass to the component.
pt—SafeRecord<OrgChartTreePassThrough>
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: OrgChartTreeInstance) => 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 OrgChartTree component.

PropType
orgchartOrgChartRootInstance
The parent OrgChart instance.
levelnumber
The level of the org chart tree.

Interfaces#

Defines passthrough(pt) options of OrgChartTree component.

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

Types#

Instance of OrgChartTree component.

Values
ComponentInstance<OrgChartTreeProps, OrgChartTreeState, OrgChartTreeExposes>

OrgChartSubtree#

Props#

Defines valid properties in OrgChartSubtree component.

PropDefaultType
ref—Ref<unknown>
The reference to the component instance.
pIftrueboolean
Whether the component should be rendered.
style—CSSProperties | ((instance?: OrgChartSubtreeInstance) => CSSProperties)
The style to apply to the component.
className—string | ((instance?: OrgChartSubtreeInstance) => 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—OrgChartSubtreeInstance
The instance to pass to the component.
pt—SafeRecord<OrgChartSubtreePassThrough>
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: OrgChartSubtreeInstance) => 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 OrgChartSubtree component.

PropType
orgchartOrgChartRootInstance
The parent OrgChart instance.

Interfaces#

Defines passthrough(pt) options of OrgChartSubtree component.

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

Types#

Instance of OrgChartSubtree component.

Values
ComponentInstance<OrgChartSubtreeProps, OrgChartSubtreeState, OrgChartSubtreeExposes>

OrgChartNode#

Props#

Defines valid properties in OrgChartNode component.

PropDefaultType
ref—Ref<unknown>
The reference to the component instance.
pIftrueboolean
Whether the component should be rendered.
style—CSSProperties | ((instance?: OrgChartNodeInstance) => CSSProperties)
The style to apply to the component.
className—string | ((instance?: OrgChartNodeInstance) => 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—OrgChartNodeInstance
The instance to pass to the component.
pt—SafeRecord<OrgChartNodePassThrough>
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: OrgChartNodeInstance) => 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 OrgChartNode component.

PropType
orgchartOrgChartRootInstance
The parent OrgChart instance.

Interfaces#

Defines passthrough(pt) options of OrgChartNode component.

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

Types#

Instance of OrgChartNode component.

Values
ComponentInstance<OrgChartNodeProps, OrgChartNodeState, OrgChartNodeExposes>

OrgChartNodeContent#

Props#

Defines valid properties in OrgChartNodeContent component.

PropDefaultType
ref—Ref<unknown>
The reference to the component instance.
pIftrueboolean
Whether the component should be rendered.
style—CSSProperties | ((instance?: OrgChartNodeContentInstance) => CSSProperties)
The style to apply to the component.
className—string | ((instance?: OrgChartNodeContentInstance) => 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—OrgChartNodeContentInstance
The instance to pass to the component.
pt—SafeRecord<OrgChartNodeContentPassThrough>
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: OrgChartNodeContentInstance) => 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 OrgChartNodeContent component.

PropType
orgchartOrgChartRootInstance
The parent OrgChart instance.

Interfaces#

Defines passthrough(pt) options of OrgChartNodeContent component.

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

Types#

Instance of OrgChartNodeContent component.

Values
ComponentInstance<OrgChartNodeContentProps, OrgChartNodeContentState, OrgChartNodeContentExposes>

OrgChartCollapseButton#

Props#

Defines valid properties in OrgChartCollapseButton component.

PropDefaultType
ref—Ref<unknown>
The reference to the component instance.
pIftrueboolean
Whether the component should be rendered.
style—CSSProperties | ((instance?: OrgChartCollapseButtonInstance) => CSSProperties)
The style to apply to the component.
className—string | ((instance?: OrgChartCollapseButtonInstance) => 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—OrgChartCollapseButtonInstance
The instance to pass to the component.
pt—SafeRecord<OrgChartCollapseButtonPassThrough>
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: OrgChartCollapseButtonInstance) => 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 OrgChartCollapseButton component.

PropType
orgchartOrgChartRootInstance
The parent OrgChart instance.

Interfaces#

Defines passthrough(pt) options of OrgChartCollapseButton component.

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

Types#

Instance of OrgChartCollapseButton component.

Values
ComponentInstance<OrgChartCollapseButtonProps, OrgChartCollapseButtonState, OrgChartCollapseButtonExposes>