Skip to content

Commit

Permalink
fix(CallOut): allow custom title tag
Browse files Browse the repository at this point in the history
  • Loading branch information
revolunet committed Feb 27, 2024
1 parent 374deb8 commit 58d1f0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CallOut.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type CallOutProps = {
id?: string;
iconId?: FrIconClassName | RiIconClassName;
title?: ReactNode;
titleAs?: `h${2 | 3 | 4 | 5 | 6}` | "p";
buttonProps?: ButtonProps;
colorVariant?: CallOutProps.ColorVariant;
classes?: Partial<Record<"root" | "title" | "text" | "button", string>>;
Expand All @@ -41,6 +42,7 @@ export const CallOut = memo(
className,
iconId,
title,
titleAs: HtmlTitleTag = "h3",
buttonProps,
colorVariant,
classes = {},
Expand Down Expand Up @@ -73,7 +75,9 @@ export const CallOut = memo(
{...rest}
>
{title !== undefined && (
<h3 className={cx(fr.cx("fr-callout__title"), classes.title)}>{title}</h3>
<HtmlTitleTag className={cx(fr.cx("fr-card__title"), classes.title)}>
{title}
</HtmlTitleTag>
)}
<p className={cx(fr.cx("fr-callout__text"), classes.text)}> {children} </p>
{buttonProps !== undefined && (
Expand Down

0 comments on commit 58d1f0d

Please sign in to comment.