Skip to content

Commit

Permalink
feat: add ID to title element
Browse files Browse the repository at this point in the history
  • Loading branch information
huwshimi authored and edlerd committed Jun 28, 2024
1 parent 57a9e0c commit 18537ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Panel/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ type TitleProps = {
* @default h4
*/
titleComponent?: ElementType;
/**
* An ID for the title element.
*/
titleId?: string;
};

type HeaderProps<L = LogoDefaultElement> = ExclusiveProps<
Expand Down Expand Up @@ -185,6 +189,7 @@ const Panel = <L = LogoDefaultElement,>({
title,
titleClassName,
titleComponent: TitleComponent = "h4",
titleId,
toggle,
wrapContent = true,
...props
Expand All @@ -208,6 +213,7 @@ const Panel = <L = LogoDefaultElement,>({
) : (
<TitleComponent
className={classNames("p-panel__title", titleClassName)}
id={titleId}
>
{title}
</TitleComponent>
Expand Down

0 comments on commit 18537ba

Please sign in to comment.