Is it possible to create a "grid" layout programmatically with add panel? #420
-
Firstly thanks for the awesome library! Is it possible to create the above layout using the api only (I can do it via drag and drop)? I may have missed something in the docs. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Glad you like it! There are some docs on the https://dockview.dev/docs/next/components/dockview#add-panel To briefly explain, you can provide a Here is a quick sandbox showing the layout you mention created using Let me know if that helps and if you have any other questions. |
Beta Was this translation helpful? Give feedback.
Glad you like it!
There are some docs on the
addPanel
method you may find useful herehttps://dockview.dev/docs/next/components/dockview#add-panel
To briefly explain, you can provide a
position
object which takes a couple of arguments which help position the panel. You can position the new panel relative to an existing panel by providingreferencePanel
or an existing group by providingreferenceGroup
. You can also provide adirection
which will be relative to thereferencePanel
orreferenceGroup
if provided and if not provided thedirection
is absolute.Here is a quick sandbox showing the layout you mention created using
addPanel
and a variety of positioning options, you could achieve the…