@@ -42,8 +42,9 @@ const App: React.FC = () => {
42
42
< Anchor . Link href = "#non-resizable" title = "Non-resizable" />
43
43
< Anchor . Link href = "#resizable" title = "Resizable" />
44
44
< Anchor . Link href = "#nested" title = "Nested" />
45
- < Anchor . Link href = "#stacked" title = "Stacked" />
46
45
< Anchor . Link href = "#scrollable" title = "Scrollable" />
46
+ < Anchor . Link href = "#percent" title = "Percent sizing" />
47
+ < Anchor . Link href = "#stacked" title = "Stacked" />
47
48
< Anchor . Link href = "#sizeinfo" title = "Sizing information" />
48
49
< Anchor . Link href = "#changes" title = "Version history" />
49
50
</ Anchor >
@@ -146,13 +147,13 @@ const App: React.FC = () => {
146
147
</ SyntaxHighlighter >
147
148
148
149
< Space . Fixed height = { 400 } >
149
- < Space . Left size = { 200 } style = { { backgroundColor : '#e0eae0' } } >
150
+ < Space . Left size = "20%" style = { { backgroundColor : '#e0eae0' } } >
150
151
{ Description ( "Left" ) }
151
152
</ Space . Left >
152
153
< Space . Fill style = { { backgroundColor : '#eee0e0' } } >
153
154
{ Description ( "Fill" ) }
154
155
</ Space . Fill >
155
- < Space . Right size = { 200 } style = { { backgroundColor : '#e0eee0' } } >
156
+ < Space . Right size = "20%" style = { { backgroundColor : '#e0eee0' } } >
156
157
{ Description ( "Right" ) }
157
158
</ Space . Right >
158
159
</ Space . Fixed >
@@ -186,7 +187,7 @@ const App: React.FC = () => {
186
187
187
188
</ Tabs . TabPane >
188
189
</ Tabs >
189
-
190
+
190
191
< h2 id = "resizable" > Resizable spaces</ h2 >
191
192
192
193
< p >
@@ -376,6 +377,75 @@ const App: React.FC = () => {
376
377
377
378
</ Tabs . TabPane >
378
379
</ Tabs >
380
+
381
+ < h2 id = "scrollable" > Scrollable spaces</ h2 >
382
+
383
+ < p >
384
+ By default, all spaces hide content that overflows the space. To make a particular space scrollable,
385
+ set the scrollable property to true. The space will then be scrollable horizontally or vertically if
386
+ the content overflows the space.
387
+ </ p >
388
+
389
+ < h2 id = "percent" > Percentage sizing</ h2 >
390
+
391
+ < p >
392
+ Anchored spaces support sizes as percentages. The specified percentage will be used as the initial size
393
+ of the space. Resizing a space will still adjust the space size.
394
+ </ p >
395
+
396
+ < Tabs defaultActiveKey = "1" >
397
+ < Tabs . TabPane tab = "Percentage left" key = "1" >
398
+
399
+ < SyntaxHighlighter language = "html" >
400
+ {
401
+ "const App = () => (\r\n" +
402
+ " <Space.Fixed height={400}>\r\n" +
403
+ " <Space.LeftResizable size=\"50%\" />\r\n" +
404
+ " <Space.Fill />\r\n" +
405
+ " </Space.Fixed>\r\n" +
406
+ ")"
407
+ }
408
+ </ SyntaxHighlighter >
409
+
410
+ < Space . Fixed height = { 400 } >
411
+ < Space . LeftResizable trackSize = { true } size = "50%" style = { { backgroundColor : '#e0eee0' } } >
412
+ { Description ( "Left 50%" ) }
413
+ </ Space . LeftResizable >
414
+ < Space . Fill trackSize = { true } style = { { backgroundColor : '#eee0e0' } } >
415
+ { Description ( "Fill" ) }
416
+ </ Space . Fill >
417
+ </ Space . Fixed >
418
+
419
+ </ Tabs . TabPane >
420
+
421
+ < Tabs . TabPane tab = "Percentage left / right" key = "2" >
422
+
423
+ < SyntaxHighlighter language = "html" >
424
+ {
425
+ "const App = () => (\r\n" +
426
+ " <Space.Fixed height={400}>\r\n" +
427
+ " <Space.LeftResizable size=\"25%\" />\r\n" +
428
+ " <Space.Fill />\r\n" +
429
+ " <Space.RightResizable size=\"25%\" />\r\n" +
430
+ " </Space.Fixed>\r\n" +
431
+ ")"
432
+ }
433
+ </ SyntaxHighlighter >
434
+
435
+ < Space . Fixed height = { 400 } >
436
+ < Space . LeftResizable trackSize = { true } size = "25%" style = { { backgroundColor : '#e0eee0' } } >
437
+ { Description ( "Left 25%" ) }
438
+ </ Space . LeftResizable >
439
+ < Space . Fill trackSize = { true } style = { { backgroundColor : '#eee0e0' } } >
440
+ { Description ( "Fill" ) }
441
+ </ Space . Fill >
442
+ < Space . RightResizable trackSize = { true } size = "25%" style = { { backgroundColor : '#e0eee0' } } >
443
+ { Description ( "Right 25%" ) }
444
+ </ Space . RightResizable >
445
+ </ Space . Fixed >
446
+
447
+ </ Tabs . TabPane >
448
+ </ Tabs >
379
449
380
450
< h2 id = "stacked" > Stacked spaces</ h2 >
381
451
@@ -392,45 +462,37 @@ const App: React.FC = () => {
392
462
{
393
463
"const App = () => (\r\n" +
394
464
" <Space.Fixed height={400}>\r\n" +
395
- " <Space.LeftResizable size={75} order={1} />\r\n" +
396
- " <Space.LeftResizable size={75} order={2} />\r\n" +
465
+ " <Space.LeftResizable size=\"10%\" order={1} />\r\n" +
466
+ " <Space.LeftResizable size=\"10%\" order={2} />\r\n" +
397
467
" <Space.Fill />\r\n" +
398
- " <Space.RightResizable size={75} order={2} />\r\n" +
399
- " <Space.RightResizable size={75} order={1} />\r\n" +
468
+ " <Space.RightResizable size=\"10%\" order={2} />\r\n" +
469
+ " <Space.RightResizable size=\"10%\" order={1} />\r\n" +
400
470
" </Space.Fixed>\r\n" +
401
471
")"
402
472
}
403
473
</ SyntaxHighlighter >
404
474
405
475
< Space . Fixed height = { 400 } >
406
- < Space . LeftResizable trackSize = { true } size = { 75 } order = { 1 } style = { { backgroundColor : '#e0eee0' } } >
476
+ < Space . LeftResizable trackSize = { true } size = "10%" order = { 1 } style = { { backgroundColor : '#e0eee0' } } >
407
477
{ Description ( "Left 1" ) }
408
478
</ Space . LeftResizable >
409
- < Space . LeftResizable trackSize = { true } size = { 75 } order = { 2 } style = { { backgroundColor : '#e0eeee' } } >
479
+ < Space . LeftResizable trackSize = { true } size = "10%" order = { 2 } style = { { backgroundColor : '#e0eeee' } } >
410
480
{ Description ( "Left 2" ) }
411
481
</ Space . LeftResizable >
412
482
< Space . Fill trackSize = { true } style = { { backgroundColor : '#eee0e0' } } >
413
483
{ Description ( "Fill" ) }
414
484
</ Space . Fill >
415
- < Space . RightResizable trackSize = { true } size = { 75 } order = { 2 } style = { { backgroundColor : '#e0eeee' } } >
485
+ < Space . RightResizable trackSize = { true } size = "10%" order = { 2 } style = { { backgroundColor : '#e0eeee' } } >
416
486
{ Description ( "Right 2" ) }
417
487
</ Space . RightResizable >
418
- < Space . RightResizable trackSize = { true } size = { 75 } order = { 1 } style = { { backgroundColor : '#e0eee0' } } >
488
+ < Space . RightResizable trackSize = { true } size = "10%" order = { 1 } style = { { backgroundColor : '#e0eee0' } } >
419
489
{ Description ( "Right 1" ) }
420
490
</ Space . RightResizable >
421
491
</ Space . Fixed >
422
492
423
493
</ Tabs . TabPane >
424
494
</ Tabs >
425
495
426
- < h2 id = "scrollable" > Scrollable spaces</ h2 >
427
-
428
- < p >
429
- By default, all spaces hide content that overflows the space. To make a particular space scrollable,
430
- set the scrollable property to true. The space will then be scrollable horizontally or vertically if
431
- the content overflows the space.
432
- </ p >
433
-
434
496
< h2 id = "sizeinfo" > Getting size information for a space</ h2 >
435
497
436
498
< p >
@@ -454,27 +516,33 @@ const App: React.FC = () => {
454
516
455
517
< h2 id = "changes" > Version history</ h2 >
456
518
457
- < p >
519
+ < div >
520
+ < strong > 0.1.4</ strong >
521
+ < ul >
522
+ < li > Add support for percentage sizing on anchored spaces</ li >
523
+ </ ul >
524
+ </ div >
525
+ < div >
458
526
< strong > 0.1.3</ strong >
459
527
< ul >
460
528
< li > Added readme</ li >
461
529
< li > Updated documentation</ li >
462
530
</ ul >
463
- </ p >
464
- < p >
531
+ </ div >
532
+ < div >
465
533
< strong > 0.1.2</ strong >
466
534
< ul >
467
535
< li > Removed ResizeSensor from spaces by default and now optionally allow live size updates with < strong > trackSize</ strong > property</ li >
468
536
< li > Added < strong > VerticallyCentered</ strong > component to vertically centre content within space</ li >
469
537
< li > Allow class names to be specified on top-level spaces < strong > ViewPort</ strong > and < strong > Fixed</ strong > </ li >
470
538
</ ul >
471
- </ p >
472
- < p >
539
+ </ div >
540
+ < div >
473
541
< strong > 0.1.0 - 0.1.1</ strong >
474
542
< ul >
475
543
< li > Initial version</ li >
476
544
</ ul >
477
- </ p >
545
+ </ div >
478
546
479
547
</ Space . Fill >
480
548
0 commit comments