Design a Decorative Divider
Last updated
Was this helpful?
In this video we show you how to design a decorative divider using just the flex and divider components.
The decorative divider is built entirely from standard Elements components, no custom component is required.
Container
Flex
Divider
Divider or SVG
Divider
Add a Container to control the divider’s overall width and vertical spacing.
Place a Flex inside it.
Set the Flex direction to Row, alignment to Centre, width to Full, and wrapping to No Wrap.
Add three Divider elements to the Flex.
Use the first and third Dividers as the horizontal rules. Give them the same theme-backed background colour and leave their borders disabled.
For the centre Divider:
Remove its background.
Enable a solid border.
Use the same colour as the outer rules.
Apply the Full border-radius token to create the rounded medallion.
The two outside Dividers expand into the available space, while the centrepiece retains its natural size. This creates two balanced rules without requiring fixed widths.
For an illustrated variation, replace the middle Divider with an SVG element. Select an SVG resource, give it a fixed theme width, and apply the same theme colour used by the rules.
The SVG file should not contain a hard-coded fill colour, allowing Elements to apply the selected theme colour.
The Flex remains on one line while the two rules automatically shorten on narrower screens. Keep the centrepiece relatively small so the rules remain visible on mobile devices.
Because the divider is purely decorative, its outer Container should normally render as a div, rather than a header or another landmark element.
Last updated
Was this helpful?
Was this helpful?

