Splitter feedback #3391
toniengelhardt
started this conversation in
General
Replies: 1 comment 1 reply
-
The splitter component has been redesigned lately for better DX. We recommend working with percentages instead of unit values (px, rems) to ensure proper SSR support. Feel free to check it here https://ark-ui.com/react/docs/components/splitter |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently implementing the Splitter component into my app. For grid-like panels the relative size values probably make a lot of sense, but a common scenario is also resizing a sidebar or nav. In that case the relative values are impractical, bc I would usually want to fix the size of the sidebar to a certain value, e.g. 16rem. Then, when I resize the browser window, I want the sidebar width to stay constant, while the content width adapts. With relative values both panels will shrink if the window shrinks and the latter is hard to achieve. Relative values for minSize and maxSize are also impractical in most cases I guess.
A solution might be to pass strings instead of numbers, e.g.
size: '50%'
orsize: '12rem'
.Another problem I stumbled into is programmatically resizing the panels, e.g. on double click I want to reset to default sizes. Currently I need to update the size of both panels manually and if I adjust them in the wrong order I get an error that the total value cannot exceed 100. Would be nice if the second panel size would always auto adjust if I set the size of the first.
As far as I understand it, the total value anyway always has to be 100, otherwise the component becomes buggy.
Beta Was this translation helpful? Give feedback.
All reactions