> ## Documentation Index
> Fetch the complete documentation index at: https://anvil.servicetitan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started - iOS

> Add Anvil2Tokens and Anvil2Components to an iOS app.

Anvil2 for iOS ships four Swift libraries. `Anvil2Tokens` is generated design tokens. `Anvil2Icons` and `Anvil2Illustrations` are the generated Lucide allowlist and illustration set. `Anvil2Components` is SwiftUI components built on those libraries. Requires iOS 17.4 or later and Xcode 26.x.

Published releases and changelogs live on [anvil2-ios](https://github.com/servicetitan/anvil2-ios/releases). The hammer package at `packages/anvil2-swift` is the source of truth; the public mirror is overwritten on each release.

## Products

| Product | Contents |
| - | - |
| `Anvil2Tokens` | Generated design tokens (`Anvil2Tokens.Semantic.…`) |
| `Anvil2Icons` | Generated icons, as the `Anvil2Icon` enum |
| `Anvil2Illustrations` | Generated illustrations, as the `Anvil2Illustration` enum |
| `Anvil2Components` | SwiftUI components, built on the three products above |

## Add the package

In hammer, the sample app depends on the local package path:

```yaml theme={null}
packages:
  anvil2-swift:
    path: ../../packages/anvil2-swift
```

Link `Anvil2Components` to your app target. Link `Anvil2Icons` or `Anvil2Illustrations` when the screen uses those assets. Consumers of the published mirror should depend on the [anvil2-ios](https://github.com/servicetitan/anvil2-ios) package the same way you add any Swift package, then select the products the app uses.

## First component

```swift theme={null}
import Anvil2Components
import SwiftUI

struct ContentView: View {
  var body: some View {
    Anvil2Placeholder()
  }
}
```

`Anvil2Placeholder` is a public `View` with an empty `init()`. It renders the text “Anvil2” using `Anvil2Tokens.Semantic.Foreground.Color.standard`.

## Working in hammer

Regenerate tokens and build only when you change this package:

```bash theme={null}
pnpm --filter @servicetitan/anvil2-swift generate
pnpm --filter @servicetitan/anvil2-swift build:ios
pnpm --filter @servicetitan/anvil2-swift test:ios
```

Do not edit `Sources/Anvil2Tokens` by hand; it is generated from `packages/carto-tokens`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.