You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**New `River` prop**: `variant`. This prop controls the layout and appearance of the River component. Two variants are available: `default` and `gridline`.
11
+
12
+
The `default` variant is the pre-existing `River` configuration and remains the default value.
13
+
14
+
The `gridline` variant adds lateral padding and borders for use within bordered grid layouts.
15
+
16
+
```jsx
17
+
<River variant="gridline"/>
18
+
```
19
+
20
+
-**New `River.Visual` prop**: `imageBackgroundColor`. Set to `'subtle'` to create a full-bleed container with a background color and the image/video centered inside with padding.
21
+
22
+
```jsx
23
+
<River variant="gridline">
24
+
<River.Visual imageBackgroundColor="subtle">
25
+
<img src="..." alt="..."/>
26
+
</River.Visual>
27
+
<River.Content>...</River.Content>
28
+
</River>
29
+
```
30
+
31
+
-**New `River.Content` prop**: `align`. Controls vertical alignment of content within its container. Values: `'center'` (default), `'block-end'`.
32
+
33
+
-**`EyebrowText` support**: `River.Content` now accepts `EyebrowText` as a child for adding small, uppercase labels above the heading.
34
+
35
+
```jsx
36
+
<River.Content>
37
+
<EyebrowText>Feature</EyebrowText>
38
+
<Heading>Title</Heading>
39
+
<Text>Description</Text>
40
+
</River.Content>
41
+
```
42
+
43
+
-**New `RiverBreakout` prop**: `variant`. This prop controls the layout and appearance of the RiverBreakout component. Two variants are available: `default` and `gridline`.
44
+
45
+
The `gridline` variant adds horizontal border lines, lateral spacing, and supports vertical dividers for the trailing component on tablet+ viewports.
-**`RiverBreakout` padded background support**: `RiverBreakout.Visual` now supports `imageBackgroundColor="subtle"` to display the visual with a padded background container that bleeds to the gridline borders.
@@ -22,7 +22,7 @@ import {River, RiverBreakout} from '@primer/react-brand'
22
22
### Default
23
23
24
24
```jsx live
25
-
<Stack>
25
+
<Stack style={{width:'100%'}}>
26
26
<River>
27
27
<River.Visual>
28
28
<img src="/images/placeholder.png" alt="placeholder, blank area with a gray background color"/>
@@ -66,10 +66,71 @@ import {River, RiverBreakout} from '@primer/react-brand'
66
66
</Stack>
67
67
```
68
68
69
+
### GridLine variant
70
+
71
+
The `gridline` variant adds lateral padding to the River component, making it suitable for use within bordered grid layouts.
72
+
73
+
```jsx live
74
+
<Stack style={{width:'100%'}}>
75
+
<River variant="gridline">
76
+
<River.Visual>
77
+
<img src="/images/placeholder.png" alt="placeholder, blank area with a gray background color"/>
78
+
</River.Visual>
79
+
<River.Content>
80
+
<Heading>GridLine variant</Heading>
81
+
<Text>Use the gridline variant when the River needs lateral spacing to align with bordered grid layouts.</Text>
82
+
<Link href="#">Call to action</Link>
83
+
</River.Content>
84
+
</River>
85
+
<River variant="gridline" align="end">
86
+
<River.Visual>
87
+
<img src="/images/placeholder.png" alt="placeholder, blank area with a gray background color"/>
88
+
</River.Visual>
89
+
<River.Content>
90
+
<Heading>GridLine variant</Heading>
91
+
<Text>The variant works with all alignment options.</Text>
92
+
<Link href="#">Call to action</Link>
93
+
</River.Content>
94
+
</River>
95
+
</Stack>
96
+
```
97
+
98
+
### Visual with background
99
+
100
+
Use the `imageBackgroundColor` prop on `River.Visual` to create a full-bleed container with a background color and the image/video centered inside with padding. This is intended for use with the `gridline` variant.
101
+
102
+
```jsx live
103
+
<Stack style={{width:'100%'}}>
104
+
<River variant="gridline">
105
+
<River.Visual imageBackgroundColor="subtle">
106
+
<img src="/images/placeholder.png" alt="placeholder, blank area with a gray background color"/>
107
+
</River.Visual>
108
+
<River.Content>
109
+
<Heading>Visual with background</Heading>
110
+
<Text>
111
+
The imageBackgroundColor prop creates a full-bleed container with a subtle background, centering the media with
112
+
padding around it.
113
+
</Text>
114
+
<Link href="#">Call to action</Link>
115
+
</River.Content>
116
+
</River>
117
+
<River variant="gridline" align="end">
118
+
<River.Visual imageBackgroundColor="subtle">
119
+
<img src="/images/placeholder.png" alt="placeholder, blank area with a gray background color"/>
120
+
</River.Visual>
121
+
<River.Content>
122
+
<Heading>Visual withbackground (end)</Heading>
123
+
<Text>The imageBackgroundColor prop works with all alignment options.</Text>
124
+
<Link href="#">Call to action</Link>
125
+
</River.Content>
126
+
</River>
127
+
</Stack>
128
+
```
129
+
69
130
### Image to text ratio
70
131
71
132
```jsx live
72
-
<Stack>
133
+
<Stack style={{width:'100%'}}>
73
134
{/* 50/50 (default) example */}
74
135
<River>
75
136
<River.Visual>
@@ -98,7 +159,7 @@ import {River, RiverBreakout} from '@primer/react-brand'
|`align`|`'start'`, `'end'`, `'center'`| <RiverAlignProp /> | Alignment of text content relative to the Visual position |
197
258
|`imageTextRatio`|`'50:50'`, `'60:40'`| <RiverImageTextRatio /> | The aspect ratio applied to the image in relation to the adjacent text. Affects overall layout proportions. |
259
+
|`variant`|`'default'`, `'gridline'`| <RiverVariantProp /> | Visual variant. Use `gridline` to add lateral padding for bordered grid layouts. |
198
260
|`className`|`string`|| Sets a custom class on the root element |
199
261
|`id`|`string`|| Sets a custom id |
200
262
|`ref`|`React.RefObject`|| Forward a Ref to the underlying DOM node |
201
263
202
264
### River.Visual and RiverBreakout.Visual <Label>Required</Label>
|`fillMedia`|`boolean`| true | Automatically styles images and video to fill and fit the width of the parent. Disable this setting if you have bespoke styling requirements. |
207
-
|`children`|`ReactElement`|| Bring your own component (BYOC) `img` or `ReactElement` (E.g. Next.js `Image` component) |
208
-
|`hasShadow`|`boolean`|`false`| Shadow applied to the `children`. Set be `false` when the child node has a transparent background. |
209
-
|`className`|`string`|| Sets a custom class on the root element |
210
-
|`id`|`string`|| Sets a custom id |
211
-
|`ref`|`React.RefObject`|| Forward a Ref to the underlying DOM node |
212
-
|`rounded`|`boolean`|`true`| Toggle visually rounded corners. Enabled by default. |
|`fillMedia`|`boolean`| true | Automatically styles images and video to fill and fit the width of the parent. Disable this setting if you have bespoke styling requirements. |
269
+
|`children`|`ReactElement`|| Bring your own component (BYOC) `img` or `ReactElement` (E.g. Next.js `Image` component) |
270
+
|`imageBackgroundColor`|`'default'`, `'subtle'`|| Applies a background color with padding around the media. Use `'subtle'` to create a full-bleed container with the image/video centered inside. Intended for use with `gridline` variant. |
271
+
|`hasShadow`|`boolean`|`false`| Shadow applied to the `children`. Set be `false` when the child node has a transparent background. |
272
+
|`className`|`string`|| Sets a custom class on the root element |
273
+
|`id`|`string`|| Sets a custom id |
274
+
|`ref`|`React.RefObject`|| Forward a Ref to the underlying DOM node |
275
+
|`rounded`|`boolean`|`true`| Toggle visually rounded corners. Enabled by default. |
213
276
214
277
### River.Content and RiverBreakout.Content <Label>Required</Label>
0 commit comments