Contents

jnozzi/leaderview

`LeaderView` is a configurable typographical element that renders a baseline "leader line" from one view to the next, as found in a book index:

Features

You can configure:

  • Inter-view spacing
  • Inter-dot spacing
  • Dot diameter
  • Dot color
  • Layout Priority (leading / trailing views)
  • Vertical alignment (default/best is last-baseline)

Example

To create a simple leader:

import LeaderView

Leader {
  Text("Chapter One: The Dottening")
    .font(.title2)
} trailingView: {
  Text("1")
    .font(.title3)
    .monospaced()
    }

To get all fancy with it:

import LeaderView

Leader(
  dotDiameter: dotDiameter,
  viewSpacing: viewSpacing,
  dotSpacing: dotSpacing,
  minLeaderWidth: minLeaderWidth
) {
  Text("Introduction")
    .font(.title2)
} trailingView: {
  Text("ii")
    .font(.title3)
    .monospaced()
    .italic()
}

Contributing

Contributions are welcome! If you'd like to contribute to LeaderView, please fork the repository and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Package Metadata

Repository: jnozzi/leaderview

Default branch: main

README: README.md