diff --git a/desktop/app/src/sandy-chrome/DesignComponentDemos.tsx b/desktop/app/src/sandy-chrome/DesignComponentDemos.tsx
index 7b64b1bf5..073eaee6a 100644
--- a/desktop/app/src/sandy-chrome/DesignComponentDemos.tsx
+++ b/desktop/app/src/sandy-chrome/DesignComponentDemos.tsx
@@ -67,8 +67,7 @@ const someText = Some text;
const demos: PreviewProps[] = [
{
title: 'Layout.Container',
- description:
- 'Layout.Container can be used to organize the UI in regions. It takes care of paddings and borders. To arrange multiple children use one of the other Layout components. If you need a margin on this component, try to wrap it in other Layout component instead.',
+ description: `Layout.Container can be used to organize the UI in regions. It takes care of paddings and borders. Children will be arranged vertically. Use Layout.Horizontal instead for arranging children horizontally. If you need a margin on this component, try to wrap it in other Layout component instead.`,
props: [
['rounded', 'boolean (false)', 'Make the corners rounded'],
[
@@ -91,6 +90,16 @@ const demos: PreviewProps[] = [
'boolean (false)',
'Use a standard padding on the top side',
],
+ [
+ 'gap',
+ 'true / number (0)',
+ 'Set the spacing between children. If just set, theme.space.small will be used.',
+ ],
+ [
+ 'center',
+ 'boolean (false)',
+ 'If set, all children will use their own naturally width, and they will be centered horizontally in the Container. If not set, all children will be stretched to the width of the Container.',
+ ],
],
demos: {
'Basic container with fixed dimensions': (
@@ -112,6 +121,52 @@ const demos: PreviewProps[] = [
child
),
+ 'Multiple children, gap={24}': (
+
+ {aButton}
+ {someText}
+ {aBox}
+ {aDynamicBox}
+
+ ),
+ 'Multiple children icmw. pad center gap': (
+
+ {aButton}
+ {someText}
+ {aBox}
+ {aDynamicBox}
+
+ ),
+ },
+ },
+ {
+ title: 'Layout.Horizontal',
+ description:
+ 'Use this component to arrange multiple items horizontally. All vanilla Container props can be used as well.',
+ props: [
+ [
+ 'center',
+ 'boolean (false)',
+ 'If set, all children will use their own height, and they will be centered vertically in the layout. If not set, all children will be stretched to the height of the layout.',
+ ],
+ ],
+ demos: {
+ 'Basic usage, gap="large"': (
+
+ {aButton}
+ {someText}
+ {aBox}
+ {aDynamicBox}
+
+ ),
+ 'Using flags: pad center gap={8} (great for toolbars and such)': (
+
+ {aButton}
+ {someText}
+ {aBox}
+ {aDynamicBox}
+
+ ),
},
},
{
@@ -139,87 +194,17 @@ const demos: PreviewProps[] = [
width: 100,
border: `2px solid ${theme.primaryColor}`,
}}>
-
+
This text is truncated because it is too long and scroll is
vertical only...
{largeChild}
-
+
),
},
},
- {
- title: 'Layout.Horizontal',
- description:
- 'Use this component to arrange multiple items horizontally. All vanilla Container props can be used as well.',
- props: [
- [
- 'gap',
- Object.keys(theme.space).join(' | ') + ' | number | true',
- 'Set the spacing between children. For `true` theme.space.small should be used. Defaults to 0.',
- ],
- [
- 'center',
- 'boolean (false)',
- 'If set, all children will use their own height, and they will be centered vertically in the layout. If not set, all children will be stretched to the height of the layout.',
- ],
- ],
- demos: {
- 'Basic usage, gap="large"': (
-
- {aButton}
- {someText}
- {aBox}
- {aDynamicBox}
-
- ),
- 'Using flags: pad center gap={8} (great for toolbars and such)': (
-
- {aButton}
- {someText}
- {aBox}
- {aDynamicBox}
-
- ),
- },
- },
- {
- title: 'Layout.Vertical',
- description:
- 'Use this component to arrange multiple items vertically. All vanilla Container props can be used as well.',
- props: [
- [
- 'gap',
- 'number (0)',
- 'Set the spacing between children. Typically theme.space.small should be used.',
- ],
- [
- 'center',
- 'boolean (false)',
- 'If set, all children will use their own height, and they will be centered vertically in the layout. If not set, all children will be stretched to the height of the layout.',
- ],
- ],
- demos: {
- 'Basic usage, gap={24}': (
-
- {aButton}
- {someText}
- {aBox}
- {aDynamicBox}
-
- ),
- 'Using flags: pad center gap (great for toolbars and such)': (
-
- {aButton}
- {someText}
- {aBox}
- {aDynamicBox}
-
- ),
- },
- },
{
title: 'Layout.Top|Left|Right|Bottom',
description:
@@ -300,11 +285,11 @@ const demos: PreviewProps[] = [
function ComponentPreview({title, demos, description, props}: PreviewProps) {
return (
-
+ {description}
-
+
{Object.entries(demos).map(([name, children]) => (