diff --git a/packages/grafana-ui/src/components/Card/Card.mdx b/packages/grafana-ui/src/components/Card/Card.mdx index 7c5622615ac..4594e8e1529 100644 --- a/packages/grafana-ui/src/components/Card/Card.mdx +++ b/packages/grafana-ui/src/components/Card/Card.mdx @@ -67,6 +67,25 @@ Metadata also accepts HTML elements, which could be links, for example. For elem +The separator for multiple metadata elements defaults to a vertical line `|`, but can be customised. + +```jsx + + + Grafana + https://ops-us-east4.grafana.net/api/prom + + +``` + + + + + Grafana + https://ops-us-east4.grafana.net/api/prom + + + ### Tags Tags can be rendered inside the Card, by being wrapped in `Card.Tags` component. Note that this component does not provide any tag styling and that should be handled by the children. It is recommended to use it with Grafana-UI's `TagList` component. diff --git a/packages/grafana-ui/src/components/Card/Card.story.internal.tsx b/packages/grafana-ui/src/components/Card/Card.story.tsx similarity index 100% rename from packages/grafana-ui/src/components/Card/Card.story.internal.tsx rename to packages/grafana-ui/src/components/Card/Card.story.tsx diff --git a/packages/grafana-ui/src/components/Card/Card.tsx b/packages/grafana-ui/src/components/Card/Card.tsx index de7c2a4adb9..8bfffe33a7c 100644 --- a/packages/grafana-ui/src/components/Card/Card.tsx +++ b/packages/grafana-ui/src/components/Card/Card.tsx @@ -290,15 +290,15 @@ const Figure: FC = ({ children, style Figure.displayName = 'Figure'; -const Meta: FC = memo(({ children, styles }) => { +const Meta: FC = memo(({ children, styles, separator = '|' }) => { let meta = children; - // Join meta data elements by '|' + // Join meta data elements by separator if (Array.isArray(children)) { meta = React.Children.toArray(children).reduce((prev, curr, i) => [ prev, - | + {separator} , curr, ]);