Separator
A line to visually separate content
Default
A simple line to separate content.
Editable example
Best practices
- Any time you find yourself writing a style just to apply a 1px border between elements consider using a
Separatorinstead. - When using an
OptionMenu, use theOptionMenuSeparator. It's just a regularSeparatorbut it has the default spacing and outset to work within anOptionMenupre-applied.
Vertical
A vertical separator to separate horizontal content.
Editable example
Size
By default Separator will fill its flex or grid container. An explicit size can also be provided.
Editable example
Spacing
Use the spacing prop to add spacing around the Separator. If possible try to use gap on a Stack or flexbox/grid container before reaching for spacing.
Editable example
Outset
Extend the separator all the way to the edges of a container if it has padding. Just set the outset prop to the same amount of spacing as the container's padding.
Editable example