River

Use the river component to introduce a feature using a type and media pairing.

import {River, RiverBreakout} from '@primer/react-brand'

Examples

Default

Loading

Image to text ratio

Loading

Video

Loading

Alternative heading levels

Loading

Duotone

Loading

River breakout

Loading

Component props

River Required

NameTypeDefaultDescription
align'start', 'end', 'center'startAlignment of text content relative to the Visual position
imageTextRatio'50:50', '60:40'50:50The aspect ratio applied to the image in relation to the adjacent text. Affects overall layout proportions.
classNamestringSets a custom class on the root element
idstringSets a custom id
refReact.RefObjectForward a Ref to the underlying DOM node

River.Visual and RiverBreakout.Visual Required

NameTypeDefaultDescription
fillMediabooleantrueAutomatically styles images and video to fill and fit the width of the parent. Disable this setting if you have bespoke styling requirements.
childrenReactElementBring your own component (BYOC) img or ReactElement (E.g. Next.js Image component)
hasShadowbooleanfalseShadow applied to the children. Set be false when the child node has a transparent background.
classNamestringSets a custom class on the root element
idstringSets a custom id
refReact.RefObjectForward a Ref to the underlying DOM node
roundedbooleantrueToggle visually rounded corners. Enabled by default.

River.Content and RiverBreakout.Content Required

Label, Text,Heading, Link are the only children accepted. They can be composed in any order, but their rendered output will always be in a predetermined order.

NameTypeDefaultDescription
childrenText,Heading, LinkContent that corrosponds to the adjacent visual.
classNamestringSets a custom class on the root element
idstringSets a custom id
refReact.RefObjectForward a Ref to the underlying DOM node

RiverBreakout

NameTypeDefaultDescription
classNamestringSets a custom class on the root element
idstringSets a custom id
refReact.RefObjectForward a Ref to the underlying DOM node

RiverBreakout.A11yHeading Required

NameTypeDefaultDescription
childrenReactNodeThe heading text that will be read aloud to screen readers, but is visually hidden.