Divider

Description of the Divider's function.

Examples

Horizontal

A simple example. The Divider is horizontal by default.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.

<div class="wrapper">
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne
    merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo
    modo.
  </p>
  <Divider />
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne
    merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo
    modo.
  </p>
  <Divider dashed />
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne
    merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo
    modo.
  </p>
</div>

<script>
  import { Divider } from "svant";
</script>

<style>
  .wrapper {
    max-width: 450px;
  }
</style>

Title

An inner title can be added using the orientation prop. The heading style can be removed with the plain prop.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.

<div class="wrapper">
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne
    merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo
    modo.
  </p>
  <Divider>Text</Divider>
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne
    merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo
    modo.
  </p>
  <Divider orientation="left">Left Text</Divider>
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne
    merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo
    modo.
  </p>
  <Divider orientation="right" plain>Plain Right Text</Divider>
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne
    merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo
    modo.
  </p>
</div>

<script>
  import { Divider } from "svant";
</script>

<style>
  .wrapper {
    max-width: 450px;
  }
</style>

Vertical

A Divider can also be vertical.

Text Link Link
<span>Text</span>
<Divider type="vertical" />
<a href="/divider">Link</a>
<Divider type="vertical" />
<a href="/divider">Link</a>

<script>
  import { Divider } from "svant";
</script>

API

Attributes

PropertyDescriptionTypeDefault
typeDirection if the divider.horizontal | verticalhorizontal
dashedWhether the line is dashed.Booleanfalse
orientationPosition of the title inside the divider.left | right | centercenter
plainMakes the title inside the divider is plain text instead of a heading.Booleanfalse
classCustom class for the divider.String|Object-
styleCustom style of the divider.String|Object-