File tree Expand file tree Collapse file tree
public/generated/code-snippets Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ {
2+ "html": "<div style=\"min-height: 1rem;\"><span class=\"tok-punctuation\"><</span><span class=\"tok-typeName\">Group</span><span class=\"\"> </span><span class=\"tok-propertyName\">autoSave</span><span class=\"\"> </span><span class=\"tok-propertyName\">id</span><span class=\"tok-operator\">=</span><span class=\"tok-string\">\"auto-save-example\"</span><span class=\"tok-punctuation\">></span><span class=\"\"></span></div>\n<div style=\"min-height: 1rem;\"><span class=\"\"> </span><span class=\"tok-punctuation\"><</span><span class=\"tok-typeName\">Panel</span><span class=\"\"> </span><span class=\"tok-propertyName\">minSize</span><span class=\"tok-operator\">=</span><span class=\"tok-punctuation\">{</span><span class=\"tok-number\">50</span><span class=\"tok-punctuation\">}</span><span class=\"tok-punctuation\">></span><span class=\"\">left</span><span class=\"tok-punctuation\"></</span><span class=\"tok-typeName\">Panel</span><span class=\"tok-punctuation\">></span><span class=\"\"></span></div>\n<div style=\"min-height: 1rem;\"><span class=\"\"> </span><span class=\"tok-punctuation\"><</span><span class=\"tok-typeName\">Panel</span><span class=\"\"> </span><span class=\"tok-propertyName\">minSize</span><span class=\"tok-operator\">=</span><span class=\"tok-punctuation\">{</span><span class=\"tok-number\">50</span><span class=\"tok-punctuation\">}</span><span class=\"tok-punctuation\">></span><span class=\"\">middle</span><span class=\"tok-punctuation\"></</span><span class=\"tok-typeName\">Panel</span><span class=\"tok-punctuation\">></span><span class=\"\"></span></div>\n<div style=\"min-height: 1rem;\"><span class=\"\"> </span><span class=\"tok-punctuation\"><</span><span class=\"tok-typeName\">Panel</span><span class=\"\"> </span><span class=\"tok-propertyName\">minSize</span><span class=\"tok-operator\">=</span><span class=\"tok-punctuation\">{</span><span class=\"tok-number\">50</span><span class=\"tok-punctuation\">}</span><span class=\"tok-punctuation\">></span><span class=\"\">right</span><span class=\"tok-punctuation\"></</span><span class=\"tok-typeName\">Panel</span><span class=\"tok-punctuation\">></span><span class=\"\"></span></div>\n<div style=\"min-height: 1rem;\"><span class=\"\"></span><span class=\"tok-punctuation\"></</span><span class=\"tok-typeName\">Group</span><span class=\"tok-punctuation\">></span></div>"
3+ }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export function NavLink({
2020 className = { cn (
2121 "px-4 cursor-pointer" ,
2222 {
23- "font-bold text-emerald-200 hover:text-white " : isActive ,
23+ "font-bold text-fuchsia-400 hover:text-fuchsia-200 " : isActive ,
2424 "opacity-50 pointer-events-none" : isPending
2525 } ,
2626 className
Original file line number Diff line number Diff line change 1+ import { Group , Panel } from "react-resizable-panels" ;
2+ import { html as ExampleHTML } from "../../public/generated/code-snippets/PersistentLayouts.json" ;
13import { Box } from "../components/Box" ;
24import { Callout } from "../components/Callout" ;
5+ import { Code } from "../components/code/Code" ;
36import { Header } from "../components/Header" ;
7+ import { Text } from "../components/Text" ;
48
59export default function PersistentLayoutsRoute ( ) {
610 return (
711 < Box direction = "column" gap = { 4 } >
812 < Header section = "Examples" title = "Persistent layouts" />
9- < Callout intent = "warning" > Coming soon</ Callout >
13+ < div >
14+ Panel groups can be configured to automatically save and restore layouts
15+ between page visits using the < code > autoSave</ code > prop. Resize the
16+ panels below and then reload the page to see an example.
17+ </ div >
18+ < Code html = { ExampleHTML } />
19+ < Group className = "h-15 gap-1" >
20+ < Panel
21+ className = "border border-2 border-slate-700 rounded"
22+ minSize = { 50 }
23+ >
24+ < Text > left</ Text >
25+ </ Panel >
26+ < Panel
27+ className = "border border-2 border-slate-700 rounded"
28+ minSize = { 50 }
29+ >
30+ < Text > center</ Text >
31+ </ Panel >
32+ < Panel
33+ className = "border border-2 border-slate-700 rounded"
34+ minSize = { 50 }
35+ >
36+ < Text > right</ Text >
37+ </ Panel >
38+ </ Group >
39+ < Callout intent = "warning" >
40+ In order to re-associate saved layouts with the appropriate group,
41+ auto-save groups require a unique < code > id</ code > prop.
42+ </ Callout >
1043 </ Box >
1144 ) ;
1245}
Original file line number Diff line number Diff line change @@ -33,8 +33,14 @@ const VERSIONS = {
3333 "3.0.6" :
3434 "https://react-resizable-panels-au2wmqbbr-brian-vaughns-projects.vercel.app/"
3535 } ,
36- "2" : { } ,
37- "1" : { }
36+ "2" : {
37+ "2.1.7" :
38+ "https://react-resizable-panels-ca7gk2gh5-brian-vaughns-projects.vercel.app/" ,
39+ "2.0.23" : ""
40+ } ,
41+ "1" : {
42+ "1.0.10" : ""
43+ }
3844} ;
3945
4046function VersionLink ( { url, version } : { url : string ; version : string } ) {
Original file line number Diff line number Diff line change 1+ import { Group , Panel } from "react-resizable-panels" ;
2+
3+ // <begin>
4+
5+ /* prettier-ignore */
6+ < Group autoSave id = "auto-save-example" >
7+ < Panel minSize = { 50 } > left</ Panel >
8+ < Panel minSize = { 50 } > middle</ Panel >
9+ < Panel minSize = { 50 } > right</ Panel >
10+ </ Group >
You can’t perform that action at this time.
0 commit comments