---
title: name
framework: swift-package-manager
role: symbol
role_heading: Instance Property
path: swift-package-manager/documentation/packagedescription/trait/name
---

# name

The trait’s canonical name.

## Declaration

```swift
var name: String
```

## Discussion

Discussion Use the trait’s name to enable the trait or when referring to it from other modifiers in the manifest. The trait’s name also defines the conditional block that the compiler supports when the trait is active. The following rules are enforced on trait names: The first character must be a Unicode XID start character (most letters), a digit, or _. Subsequent characters must be a Unicode XID start character (a digit, _, or most letters), -, or +. The names default and defaults (in any letter casing combination) aren’t allowed as trait names to avoid confusion with default traits.

## See Also

### Inspecting Traits

- [description](swift-package-manager/documentation/packagedescription/trait/description.md)
- [enabledTraits](swift-package-manager/documentation/packagedescription/trait/enabledtraits.md)
