---
title: URL.FormatStyle.ComponentDisplayOption
framework: foundation
role: symbol
role_heading: Structure
path: foundation/url/formatstyle/componentdisplayoption
---

# URL.FormatStyle.ComponentDisplayOption

A type that indicates whether a formatted URL should include a component.

## Declaration

```swift
struct ComponentDisplayOption
```

## Topics

### Display options

- [always](foundation/url/formatstyle/componentdisplayoption/always.md)
- [never](foundation/url/formatstyle/componentdisplayoption/never.md)
- [omitIfHTTPFamily](foundation/url/formatstyle/componentdisplayoption/omitifhttpfamily.md)
- [displayWhen(_:matches:)](foundation/url/formatstyle/componentdisplayoption/displaywhen(_:matches:).md)
- [omitWhen(_:matches:)](foundation/url/formatstyle/componentdisplayoption/omitwhen(_:matches:).md)
- [URL.FormatStyle.Component](foundation/url/formatstyle/component.md)

## Relationships

### Conforms To

- [CustomStringConvertible](swift/customstringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Creating a URL format style

- [init(scheme:user:password:host:port:path:query:fragment:)](foundation/url/formatstyle/init(scheme:user:password:host:port:path:query:fragment:).md)
- [URL.FormatStyle.HostDisplayOption](foundation/url/formatstyle/hostdisplayoption.md)
