import {FieldsetModule} from 'primeng/primeng';
Fieldset is defined with p-fieldset element.
<p-fieldset legend="Header">
Content
</p-fieldset>
Content of the fieldset can be expanded and collapsed using toggleable option, default state is defined with collapsed option.
<p-fieldset legend="Header" toggleable="true">
Content
</p-fieldset>
Name | Type | Default | Description |
---|---|---|---|
legend | string | null | Header text of the fieldset. |
toggleable | boolean | false | When specified, content can toggled by clicking the legend. |
collapsed | boolean | false | Defines the default visibility state of the content. |
Name | Parameters | Description |
---|---|---|
onBeforeToggle | event.originalEvent: browser event event.collapsed: state as a boolean |
Callback to invoke before content toggle. |
onAfterToggle | event.originalEvent: browser event event.collapsed: state as a boolean |
Callback to invoke after content toggle. |
Following is the list of structural style classes, for theming classes visit theming page.
Name | Element |
---|---|
ui-fieldset | Fieldset element |
ui-fieldset-toggleable | Toggleable fieldset element |
ui-fieldset-legend | Legend element. |
ui-fieldset-content | Content element. |
None.
<p-fieldset legend="Godfather I">
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-fieldset>
<p-fieldset legend="Toggleable" 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-fieldset>