Merge pull request #678 from mathuo/677-floating-panel-documentation-example-not-working

chore: fix documentation
This commit is contained in:
mathuo 2024-08-05 21:28:53 +01:00 committed by GitHub
commit ed3fd57d6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -155,16 +155,24 @@ const panel = api.addPanel({
You should specific the `floating` option which can be either `true` or an object describing the position of the floating group.
:::info
The `position` property of the `floating` object accepts combinations of `top`, `left`, `bottom` and `right`.
:::
```ts
api.addPanel({
id: 'panel_1',
component: 'default',
floating: true,
floating: true
});
api.addPanel({
id: 'panel_2',
component: 'default',
floating: { left: 10, top: 10, width: 300, height: 300 },
floating: {
position: { left: 10, top: 10 },
width: 300,
height: 300
}
});
```