Component Catalog — Layout Components¶
Part of: Component Catalog See also: Input Components | List Components
Layout components are located in src/components/layouts/.
TabLayout¶
Outermost wrapper for Settings tabs. Provides fixed bottom toolbar.
Import: import TabLayout from "src/components/layouts/TabLayout"
Props:
Prop |
Type |
Description |
|---|---|---|
|
|
Layout identifier |
|
|
Toolbar buttons |
const toolbarFields = [
{ key: 0, element: <Button variant="secondary" onClick={onRefresh}>Refresh</Button> },
{ key: 1, element: <Button variant="secondary" isDisabled={!isModified} onClick={onRevert}>Revert</Button> },
{ key: 2, element: <Button variant="primary" isDisabled={!isModified} type="submit">Save</Button> },
{ key: 3, element: <KebabLayout direction="up" dropdownItems={kebabItems} /> },
];
<TabLayout id="settings-page" toolbarItems={toolbarFields}>
{/* Content */}
</TabLayout>
TitleLayout¶
Section heading with consistent styling.
Import: import TitleLayout from "src/components/layouts/TitleLayout"
Props:
Prop |
Type |
Description |
|---|---|---|
|
|
Heading level |
|
|
Section ID (for jump links) |
|
|
Section title |
KebabLayout¶
Kebab menu (three dots) with dropdown actions.
Import: import KebabLayout from "src/components/layouts/KebabLayout"
Props:
Prop |
Type |
Description |
|---|---|---|
|
|
Dropdown direction |
|
|
Menu items |
Important: Use direction="up" when kebab is in the bottom toolbar.
HelpTextWithIconLayout¶
Help button with question mark icon.
Import: import HelpTextWithIconLayout from "src/components/layouts/HelpTextWithIconLayout"
Props:
Prop |
Type |
Description |
|---|---|---|
|
|
Button text |
|
|
Click handler |
SettingsTableLayout¶
Table layout for displaying key-value pairs in Settings.
Import: import SettingsTableLayout from "src/components/layouts/SettingsTableLayout"
Modal Components¶
ModalWithFormLayout¶
Base modal component for forms with field definitions.
Import: import ModalWithFormLayout, { Field } from "src/components/layouts/ModalWithFormLayout"
Props:
Prop |
Type |
Description |
|---|---|---|
|
|
Test identifier |
|
|
Modal size |
|
|
Modal position |
|
|
Offset from top (e.g., |
|
|
Modal title |
|
|
Form ID for submit button |
|
|
Form field definitions |
|
|
Controls visibility |
|
|
Submit handler |
|
|
Close handler |
|
|
Action buttons |
Field definition:
interface Field {
id: string;
name: string;
pfComponent: ReactNode;
fieldRequired?: boolean;
}
Example:
const fields: Field[] = [
{
id: "modal-form-name",
name: "Name",
pfComponent: <TextInput id="modal-form-name" value={name} onChange={setName} />,
fieldRequired: true,
},
];
<ModalWithFormLayout
dataCy="add-entity-modal"
variantType="small"
modalPosition="top"
offPosition="76px"
title="Add entity"
formId="add-modal-form"
fields={fields}
show={isOpen}
onSubmit={onAdd}
onClose={onClose}
actions={modalActions}
/>
ModalWithTextAreaLayout¶
Modal with text area content.
Import: import ModalWithTextAreaLayout from "src/components/layouts/ModalWithTextAreaLayout"
Other Layout Components¶
Component |
Import |
Use Case |
|---|---|---|
|
|
Info popover with icon |
|
|
Expandable card (used in certificates) |
|
|
Dual list selector |
|
|
Loading spinner |
|
|
Secondary action button |
|
|
Text input with required indicator |
Generic Section Components¶
For complex sections with the Category Toggle + Tables pattern:
CategoryToggleSection¶
Import: import CategoryToggleSection from "src/components/CategoryToggleSection/CategoryToggleSection"
See sub-pages/15-category-toggle-sections.md for detailed usage.