diff --git a/packages/grafana-ui/src/components/PanelChrome/HoverWidget.tsx b/packages/grafana-ui/src/components/PanelChrome/HoverWidget.tsx
index 188f6c8158d..6a78d7d9389 100644
--- a/packages/grafana-ui/src/components/PanelChrome/HoverWidget.tsx
+++ b/packages/grafana-ui/src/components/PanelChrome/HoverWidget.tsx
@@ -10,7 +10,7 @@ import { PanelMenu } from './PanelMenu';
interface Props {
children?: React.ReactNode;
- menu: ReactElement | (() => ReactElement);
+ menu?: ReactElement | (() => ReactElement);
title?: string;
offset?: number;
dragClass?: string;
@@ -41,17 +41,19 @@ export function HoverWidget({ menu, title, dragClass, children, offset = -32 }:
style={{ top: `${offset}px` }}
data-testid="hover-header-container"
>
-
-
-
+ {dragClass && (
+
+
+
+ )}
{!title && Untitled
}
{children}
-
+ )}
);
}
@@ -92,7 +94,6 @@ function getStyles(theme: GrafanaTheme2) {
alignItems: 'center',
width: theme.spacing(4),
height: '100%',
- paddingRight: theme.spacing(0.5),
}),
draggable: css({
cursor: 'move',
@@ -109,12 +110,10 @@ function getStyles(theme: GrafanaTheme2) {
background: theme.colors.secondary.main,
},
}),
- title: css({
- padding: theme.spacing(0.75),
- }),
untitled: css({
color: theme.colors.text.disabled,
fontStyle: 'italic',
+ padding: theme.spacing(0, 1),
marginBottom: 0,
}),
draggableIcon: css({
diff --git a/packages/grafana-ui/src/components/PanelChrome/PanelChrome.mdx b/packages/grafana-ui/src/components/PanelChrome/PanelChrome.mdx
index 868b714d1b3..d635f6c6371 100644
--- a/packages/grafana-ui/src/components/PanelChrome/PanelChrome.mdx
+++ b/packages/grafana-ui/src/components/PanelChrome/PanelChrome.mdx
@@ -56,7 +56,7 @@ Component used for rendering content wrapped in the same style as grafana panels
style={{
width: innerwidth,
height: innerheight,
- background: 'gray',
+ background: 'rgba(230,0,0,0.05)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
@@ -133,7 +133,7 @@ Component used for rendering content wrapped in the same style as grafana panels
style={{
width: innerwidth,
height: innerheight,
- background: 'gray',
+ background: 'rgba(230,0,0,0.05)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
@@ -170,7 +170,7 @@ Component used for rendering content wrapped in the same style as grafana panels
style={{
width: innerwidth,
height: innerheight,
- background: 'gray',
+ background: 'rgba(230,0,0,0.05)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
@@ -202,7 +202,7 @@ Component used for rendering content wrapped in the same style as grafana panels
style={{
width: innerwidth,
height: innerheight,
- background: 'white',
+ background: 'rgba(230,0,0,0.05)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
@@ -232,7 +232,7 @@ Component used for rendering content wrapped in the same style as grafana panels
style={{
width: innerwidth,
height: innerheight,
- background: 'gray',
+ background: 'rgba(230,0,0,0.05)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
@@ -258,7 +258,7 @@ Component used for rendering content wrapped in the same style as grafana panels
style={{
width: innerwidth,
height: innerheight,
- background: 'gray',
+ background: 'rgba(230,0,0,0.05)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
@@ -285,7 +285,7 @@ Component used for rendering content wrapped in the same style as grafana panels
style={{
width: innerwidth,
height: innerheight,
- background: 'gray',
+ background: 'rgba(230,0,0,0.05)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
@@ -300,7 +300,7 @@ Component used for rendering content wrapped in the same style as grafana panels
-### Extra options? Title Items
+### Extra options? Title items and actions
```tsx
}
- description="Here I will put a description that explains a bit more this panel"
- width={400}
+ actions={
+
+ }
+ width={500}
height={200}
>
{(innerwidth, innerheight) => {
@@ -321,7 +325,7 @@ Component used for rendering content wrapped in the same style as grafana panels
style={{
width: innerwidth,
height: innerheight,
- background: 'white',
+ background: 'rgba(230,0,0,0.05)',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
@@ -337,14 +341,18 @@ Component used for rendering content wrapped in the same style as grafana panels