Skip to content

Commit 12e6819

Browse files
authored
fix(PageHeader) Add the option to change the classname applied to the h1 (#691)
1 parent 108c6e1 commit 12e6819

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/module/src/PageHeader/PageHeader.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export interface PageHeaderProps extends React.PropsWithChildren {
4242
ouiaId?: string | number;
4343
/** Child nodes */
4444
children?: React.ReactNode;
45+
/** Optional classname that replaces the existing classname on the h1 element */
46+
headingClassname?: string;
4547
}
4648

4749
const useStyles = createUseStyles({
@@ -59,7 +61,8 @@ export const PageHeader: React.FunctionComponent<PageHeaderProps> = ({
5961
breadcrumbs = null,
6062
actionMenu,
6163
ouiaId = 'PageHeader',
62-
children = null
64+
children = null,
65+
headingClassname,
6366
}: PageHeaderProps) => {
6467
const classes = useStyles();
6568
const { isExternal = false, ...linkRestProps } = linkProps ?? {};
@@ -92,7 +95,7 @@ export const PageHeader: React.FunctionComponent<PageHeaderProps> = ({
9295
<Split hasGutter>
9396
{title && (
9497
<SplitItem>
95-
<Content className="pf-v6-u-mb-sm" component="h1" ouiaId={`${ouiaId}-title`}>
98+
<Content className={headingClassname ?? 'pf-v6-u-mb-sm'} component="h1" ouiaId={`${ouiaId}-title`}>
9699
{title}
97100
</Content>
98101
</SplitItem>

0 commit comments

Comments
 (0)