Lists

Lists can be ordered or unordered, and you can customize their bullet styles too.

A simple list can be made up just of hard-coded strings, like this:

List {
    "This is a list item"
    "So is this"
    "And this"
}

Alternatively, you can pass in an array like this:

List(User.examples) { user in
    user.name
}

Lists are unordered by default. Use the listStyle() modifier to change that:

List {
    "This is the first list item"
    "This is the second one"
    "And here's one more"
}
.listStyle(.ordered(.default))
  1. This is the first list item
  2. This is the second one
  3. And here's one more

You can customize the bullet style by adjusting the list style. For example, here are Roman numerals:

List {
    "Veni"
    "Vidi"
    "Vici"
}
.listStyle(.ordered(.lowerRoman))
  1. Veni
  2. Vidi
  3. Vici

And here is a custom style using emoji:

List {
    "The players gonna play"
    "Haters gonna hate"
    "Fakers gonna fake"
}
.listMarkerStyle(.custom("๐Ÿ’ƒ"))

Created in Swift with Ignite

Ignite v0.5.2 ยท Updated 22/04/25