diff --git a/packages/web-react/src/components/Stack/README.md b/packages/web-react/src/components/Stack/README.md
index 98917cdca7..e82c4e360d 100644
--- a/packages/web-react/src/components/Stack/README.md
+++ b/packages/web-react/src/components/Stack/README.md
@@ -31,32 +31,36 @@ Advanced example usage:
## Custom Spacing
You can use the `spacing` prop to apply custom spacing between items. The prop
-accepts either a spacing token (eg. `space-100`) or an object with breakpoint keys and spacing token values.
+accepts either a spacing token (e.g. `space-100`) or an object with breakpoint keys and spacing token values.
+
+Default spacing:
```jsx
-
- Block 1
- Block 2
- Block 3
-
+{/* Stacked content */}
+```
-
- Block 1
- Block 2
- Block 3
-
+Custom spacing:
+
+```jsx
+{/* Stacked content */}
+```
+
+Custom responsive spacing:
+
+```jsx
+{/* Stacked content */}
```
## API
-| Name | Type | Default | Required | Description |
-| ------------------------- | ---------------------------------------------------------------- | ------- | -------- | ------------------------------------------------------------------- |
-| `elementType` | `string` | `div` | ✕ | Element type of the wrapper element |
-| `hasEndDivider` | `bool` | `false` | ✕ | Render a divider after the last item |
-| `hasIntermediateDividers` | `bool` | `false` | ✕ | Render dividers between items |
-| `hasSpacing` | `bool` | `false` | ✕ | Apply a spacing between items |
-| `hasStartDivider` | `bool` | `false` | ✕ | Render a divider before the first item |
-| `spacing` | [`SpaceToken` \| `Partial>`] | — | ✕ | Custom spacing between items, see [Custom Spacing](#custom-spacing) |
+| Name | Type | Default | Required | Description |
+| ------------------------- | ---------------------------------------------------------------- | ------- | -------- | ----------------------------------------------------- |
+| `elementType` | `string` | `div` | ✕ | Element type of the wrapper element |
+| `hasEndDivider` | `bool` | `false` | ✕ | Render a divider after the last item |
+| `hasIntermediateDividers` | `bool` | `false` | ✕ | Render dividers between items |
+| `hasSpacing` | `bool` | `false` | ✕ | Apply default spacing between items |
+| `hasStartDivider` | `bool` | `false` | ✕ | Render a divider before the first item |
+| `spacing` | [`SpaceToken` \| `Partial>`] | — | ✕ | Apply [custom spacing](#custom-spacing) between items |
On top of the API options, the components accept [additional attributes][readme-additional-attributes].
If you need more control over the styling of a component, you can use [style props][readme-style-props]
diff --git a/packages/web-react/src/components/Stack/__tests__/Stack.test.tsx b/packages/web-react/src/components/Stack/__tests__/Stack.test.tsx
index 2b58c89d61..ffd3332769 100644
--- a/packages/web-react/src/components/Stack/__tests__/Stack.test.tsx
+++ b/packages/web-react/src/components/Stack/__tests__/Stack.test.tsx
@@ -49,7 +49,7 @@ describe('Stack', () => {
});
it('should render with custom spacing', () => {
- const dom = render();
+ const dom = render();
const element = dom.container.querySelector('div') as HTMLElement;
expect(element).toHaveClass('Stack--hasSpacing');
@@ -57,9 +57,7 @@ describe('Stack', () => {
});
it('should render with custom spacing for each breakpoint', () => {
- const dom = render(
- ,
- );
+ const dom = render();
const element = dom.container.querySelector('div') as HTMLElement;
expect(element).toHaveClass('Stack--hasSpacing');
@@ -69,7 +67,7 @@ describe('Stack', () => {
});
it('should render with custom spacing for only one breakpoint', () => {
- const dom = render();
+ const dom = render();
const element = dom.container.querySelector('div') as HTMLElement;
expect(element).toHaveClass('Stack--hasSpacing');
diff --git a/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacing.tsx b/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacing.tsx
index a1edf415d8..d53588185d 100644
--- a/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacing.tsx
+++ b/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacing.tsx
@@ -3,7 +3,7 @@ import DocsBox from '../../../../docs/DocsBox';
import Stack from '../Stack';
const StackBlocksWithCustomSpacing = () => (
-
+
{[1, 2, 3].map((i) => (
Block {i}
diff --git a/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacingAndDividers.tsx b/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacingAndDividers.tsx
index dc12608e9a..87b0552a78 100644
--- a/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacingAndDividers.tsx
+++ b/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacingAndDividers.tsx
@@ -3,7 +3,7 @@ import DocsBox from '../../../../docs/DocsBox';
import Stack from '../Stack';
const StackBlocksWithCustomSpacingAndDividers = () => (
-
+
{[1, 2, 3].map((i) => (
Block {i}
diff --git a/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacingForEachBreakpoint.tsx b/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacingForEachBreakpoint.tsx
index d863c2b756..c7d35b18b2 100644
--- a/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacingForEachBreakpoint.tsx
+++ b/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacingForEachBreakpoint.tsx
@@ -3,7 +3,7 @@ import DocsBox from '../../../../docs/DocsBox';
import Stack from '../Stack';
const StackBlocksWithCustomSpacingForEachBreakpoint = () => (
-
+
{[1, 2, 3].map((i) => (
Block {i}
diff --git a/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacingFromTabletBreakpoint.tsx b/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacingFromTabletBreakpoint.tsx
index 331393a091..54955ce0c7 100644
--- a/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacingFromTabletBreakpoint.tsx
+++ b/packages/web-react/src/components/Stack/demo/StackBlocksWithCustomSpacingFromTabletBreakpoint.tsx
@@ -3,7 +3,7 @@ import DocsBox from '../../../../docs/DocsBox';
import Stack from '../Stack';
const StackBlocksWithCustomSpacingFromTabletBreakpoint = () => (
-
+
{[1, 2, 3].map((i) => (
Block {i}
diff --git a/packages/web-react/src/components/Stack/useStackStyleProps.ts b/packages/web-react/src/components/Stack/useStackStyleProps.ts
index ec528d7f5a..8e83eaaba4 100644
--- a/packages/web-react/src/components/Stack/useStackStyleProps.ts
+++ b/packages/web-react/src/components/Stack/useStackStyleProps.ts
@@ -27,7 +27,7 @@ export function useStackStyleProps(props: SpiritS
const classProps = classNames(StackClass, {
[StackBottomDividerClass]: hasEndDivider,
[StackMiddleDividersClass]: hasIntermediateDividers,
- [StackSpacingClass]: hasSpacing,
+ [StackSpacingClass]: hasSpacing || spacing,
[StackTopDividerClass]: hasStartDivider,
});