Vertical rule

Source: https://getbootstrap.com/docs/6.0/helpers/vertical-rule

Use the custom vertical rule helper to create vertical dividers like the <hr> element.

How it works

Vertical rules are inspired by the <hr> element, allowing you to create vertical dividers in common layouts. They’re styled just like <hr> elements:

  • They’re 1px wide
  • They have min-height of 1em
  • Their color is set via currentColor and opacity

Customize them with additional styles as needed.

Example

<Example code={<div class="vr"></div>} />

Vertical rules scale their height in flex layouts:

&lt;div class="vr">&lt;/div>

</div>`} />

With stacks

They can also be used in stacks:

&lt;div class="p-2">First item&lt;/div>
&lt;div class="p-2 ms-auto">Second item&lt;/div>
&lt;div class="vr">&lt;/div>
&lt;div class="p-2">Third item&lt;/div>

</div>`} />

CSS

Vertical rules use a CSS variable with fallback for their default border width. Out of the box, --vr-border-width is unassigned, meaning it defaults to the value of --border-width.