Skip to content

Commit 26a5c2f

Browse files
authored
[Alert] Accept ReactNode in title prop (#650)
1 parent d11e161 commit 26a5c2f

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/components/Alert/Alert.stories.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,27 @@ export const Playground = {
4545
dismissible: false,
4646
},
4747
};
48+
49+
export const TitleWithLink = {
50+
args: {
51+
title: (
52+
<>
53+
Important: Please review our{" "}
54+
<a
55+
href={"https://clickhouse.com/docs"}
56+
target="_blank"
57+
rel="noopener noreferrer"
58+
>
59+
documentation
60+
</a>{" "}
61+
before progressing
62+
</>
63+
),
64+
text: "Example demos how you can pass react elements like links to the title prop",
65+
state: "info",
66+
size: "medium",
67+
type: "default",
68+
showIcon: true,
69+
dismissible: false,
70+
},
71+
};

src/components/Alert/Alert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type AlertSize = "small" | "medium";
88
type AlertState = "neutral" | "success" | "warning" | "danger" | "info";
99
export type AlertProps = {
1010
state?: AlertState;
11-
title?: string;
11+
title?: ReactNode;
1212
text: ReactNode;
1313
size?: AlertSize;
1414
type?: AlertType;

0 commit comments

Comments
 (0)