We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the changes the width of a pane and then refreshes the changes width needs to persist
current behaviour
The text was updated successfully, but these errors were encountered:
I'm searching similar
Sorry, something went wrong.
Found it https://www.npmjs.com/package/resizable-panes-react
You can achieve it using local storage.
Here is the sample code.
import { Allotment } from "allotment" const LOCAL_STORAGE_KEY = "splitSizes" let initialSizes = [500, 500, 500] if (typeof window !== "undefined") { const savedSizes = localStorage.getItem(LOCAL_STORAGE_KEY) if (savedSizes) { initialSizes = JSON.parse(savedSizes) } } function Test() { return ( <> <Allotment defaultSizes={initialSizes} onDragEnd={(sizes) => { if (typeof window !== "undefined") { localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(sizes)) } }} > <div>First</div> <div>Second</div> <div>Third</div> </Allotment> </> ) } export default Test
No branches or pull requests
When the changes the width of a pane and then refreshes the changes width needs to persist
current behaviour
Screen.Recording.2024-04-16.at.1.27.00.PM.mov
The text was updated successfully, but these errors were encountered: