Panel Panel is a grouping component providing with content toggle and close features.
The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding. His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.

Import

import {Panel} from 'primeng/primeng';

Getting Started

Panel is defined with p-panel element.

<p-panel header="Title">
    Content
</p-panel>

Toggleable

Content of the panel can be expanded and collapsed using toggleable option. Duration of the toggle effect is customized with toggleDuration and default state is defined with collapsed option. Orientation is "vertical" by default and other possible value is "horizontal".

<p-panel header="Title" toggleable="true">
    Content
</p-panel>

Attributes

Name Type Default Description
header string null Header text of the panel.
toggleable boolean false Defines if content of panel can be expanded and collapsed.
toggleDuration any normal Duration of the effect in milliseconds or pre-defined values like "slow","normal" and "fast".
toggleOrientation string vertical Defines orientation of toggle direction, valid values are "vertical" and "horizontal".
collapsed boolean false When specified, displays the panel as collapsed initially.
closable boolean false Defines if panel can be hidden using close option.
closeDuration any normal Duration of the effect in milliseconds or pre-defined values like "slow","normal" and "fast".

Events

Name Parameters Description
onBeforeCollapse event: Toggle event Callback to invoke before content is collapsed.
onAfterCollapse event: Toggle event Callback to invoke after content is collapsed.
onBeforeExpand event: Toggle event Callback to invoke before content is expanded.
onAfterExpand event: Toggle event Callback to invoke after content is expanded.
onBeforeClose event: Toggle event Callback to invoke before panel is closed.
onAfterClose event: Toggle event Callback to invoke after panel is closed.

Dependencies

jQuery, jQuery UI WidgetFactory API, PrimeUI Panel.

<p-panel header="Godfather I" toggleable="true">
    The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding. 
    His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. 
    Through Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, 
    kind and benevolent to those who give respect, but given to ruthless violence whenever anything stands against the good of the family.
</p-panel>