diff --git a/packages/docs/PropTables/IconPropTable.tsx b/packages/docs/PropTables/IconPropTable.tsx
index acc308723..7dbf39a40 100644
--- a/packages/docs/PropTables/IconPropTable.tsx
+++ b/packages/docs/PropTables/IconPropTable.tsx
@@ -8,8 +8,8 @@ export const IconPropTable: React.FC = () => (
Color}>
Sets the icon color given a color name from our palette.
- Spacing, 'number']}>
- Determines the size of the icon. Accepts a Spacing value or a number of px.
+ Spacing, 'number']}>
+ Determines the size of the icon. Accepts a Spacing value or a number of px.
);
diff --git a/packages/docs/components/SideNav/SideNav.tsx b/packages/docs/components/SideNav/SideNav.tsx
index defe86cc9..a381fb564 100644
--- a/packages/docs/components/SideNav/SideNav.tsx
+++ b/packages/docs/components/SideNav/SideNav.tsx
@@ -23,6 +23,9 @@ export const SideNav: React.FC = () => {
Icons
+
+ Spacing
+
diff --git a/packages/docs/next.config.js b/packages/docs/next.config.js
index 6937b06b9..33073c15c 100644
--- a/packages/docs/next.config.js
+++ b/packages/docs/next.config.js
@@ -35,6 +35,7 @@ module.exports = {
'/panel': { page: '/Panel/PanelPage' },
'/progress/bar': { page: '/Progress/ProgressBarPage' },
'/progress/circle': { page: '/Progress/ProgressCirclePage' },
+ '/spacing': { page: '/Spacing/SpacingPage' },
'/tabs': { page: '/Tabs/TabsPage' },
'/tooltip': { page: '/Tooltip/TooltipPage' },
'/typography': { page: '/Typography/TypographyPage' },
diff --git a/packages/docs/pages/Spacing/SpacingPage.tsx b/packages/docs/pages/Spacing/SpacingPage.tsx
new file mode 100644
index 000000000..fbb0a9742
--- /dev/null
+++ b/packages/docs/pages/Spacing/SpacingPage.tsx
@@ -0,0 +1,74 @@
+import { Box, Button, Flex, H0, H2, Link, Text } from '@bigcommerce/big-design';
+import { ThemeInterface } from '@bigcommerce/big-design-theme';
+import React, { useContext } from 'react';
+import styled, { ThemeContext } from 'styled-components';
+
+import { Code, CodePreview } from '../../components';
+
+type Spacings = ThemeInterface['spacing'];
+type Spacing = keyof Spacings;
+
+const BlueBox = styled(Box)(({ theme }) => ({
+ backgroundColor: theme.colors.primary,
+ display: 'inline-block',
+ height: theme.spacing.large,
+ width: theme.spacing.large,
+}));
+
+const StyledText = styled(Text)`
+ padding: 0;
+ margin: 0;
+`;
+
+export default () => {
+ const { spacing } = useContext(ThemeContext);
+
+ return (
+ <>
+ Spacing
+
+
+ Spacing can be used directly on certain properties that expect a size value, like{' '}
+ Margin and Padding.
+
+
+
+ {/* jsx-to-string:start */}
+ <>
+
+
+ >
+ {/* jsx-to-string:end */}
+
+
+ You can also use spacing directly from the theme to style other components, for example:
+
+
+ {/* jsx-to-string:start */}
+ {function Example() {
+ const StyledBox = styled(Box)(({ theme }) => ({
+ backgroundColor: theme.colors.primary,
+ height: theme.spacing.large,
+ width: theme.spacing.large,
+ }));
+
+ return ;
+ }}
+ {/* jsx-to-string:end */}
+
+
+
Available Spacing
+
+
+ {Object.keys(spacing)
+ .reverse()
+ .map(key => (
+
+ {key}
+
+
+ ))}
+
+ >
+ );
+};
diff --git a/packages/docs/pages/Utilities/MarginPage.tsx b/packages/docs/pages/Utilities/MarginPage.tsx
index 9e2b06e5e..e22f60f89 100644
--- a/packages/docs/pages/Utilities/MarginPage.tsx
+++ b/packages/docs/pages/Utilities/MarginPage.tsx
@@ -10,7 +10,7 @@ export default () => (
Some of our components expose a simple way to modify their margin. The following example showcases the simples way
- to use the margin prop by giving it a Spacing value.
+ to use the margin prop by giving it a Spacing value.
@@ -22,7 +22,7 @@ export default () => (
You can also specify margins with an object to handle different margins with different
breakpoints. All values must be of
- Spacing type.
+ Spacing type.
diff --git a/packages/docs/pages/Utilities/PaddingPage.tsx b/packages/docs/pages/Utilities/PaddingPage.tsx
index bf3618568..e4160b845 100644
--- a/packages/docs/pages/Utilities/PaddingPage.tsx
+++ b/packages/docs/pages/Utilities/PaddingPage.tsx
@@ -10,7 +10,7 @@ export default () => (
Some of our components expose a simple way to modify their padding. The following example showcases the simples
- way to use the padding prop by giving it a Spacing value.
+ way to use the padding prop by giving it a Spacing value.
@@ -24,7 +24,7 @@ export default () => (
You can also specify paddings with an object to handle different paddings with different
breakpoints. All values must be of
- Spacing type.
+ Spacing type.