Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fine-phones-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lg-charts/chart-card': minor
---

Supports `React.ReactNode` as type for `title` prop
2 changes: 1 addition & 1 deletion charts/chart-card/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { Chart } from '@lg-charts/core';

| Name | Description | Type | Default |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | ------- |
| `title` | The title to display in the chart header. | `string` | |
| `title` | The title to display in the chart header. | `React.ReactNode` | |
| `defaultOpen` _(optional)_ | Defines the default state of the card. | `boolean` | `true` |
| `isOpen` _(optional)_ | Forces the card state. | `boolean` | |
| `onToggleButtonClick` _(optional)_ | Callback fired when a user clicks the open/close toggle button. | `(event: MouseEventHandler<HTMLButtonElement>) => void` | |
Expand Down
2 changes: 1 addition & 1 deletion charts/chart-card/src/ChartCard/ChartCard.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface ChartCardProps
/**
* The title of the card
*/
title: string;
title: React.ReactNode;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to completely open this up to anything, then I think we should probably do the same for an individual ChartHeader https://github.com/mongodb/leafygreen-ui/blob/main/charts/core/src/ChartHeader/ChartHeader.types.ts#L8


/**
* Defines the default state of the card
Expand Down
Loading