---
title: FilePath.Component
framework: system
role: symbol
role_heading: Structure
path: system/filepath/component
---

# FilePath.Component

Represents an individual, non-root component of a file path.

## Declaration

```swift
struct Component
```

## Overview

Overview Components can be one of the special directory components (. or ..) or a file or directory name. Components are never empty and never contain the directory separator. Example: var path: FilePath = "/tmp" let file: FilePath.Component = "foo.txt" file.kind == .regular           // true file.extension                  // "txt" path.append(file)               // path is "/tmp/foo.txt"

## Topics

### Initializers

- [init(_:)](system/filepath/component/init(_:).md)
- [init(platformString:)](system/filepath/component/init(platformstring:)-2tz4.md)
- [init(platformString:)](system/filepath/component/init(platformstring:)-3mzo3.md)
- [init(platformString:)](system/filepath/component/init(platformstring:)-8kixy.md)
- [init(platformString:)](system/filepath/component/init(platformstring:)-9a3qq.md)

### Instance Properties

- [extension](system/filepath/component/extension.md)
- [kind](system/filepath/component/kind-swift.property.md)
- [stem](system/filepath/component/stem.md)
- [string](system/filepath/component/string.md)

### Instance Methods

- [withPlatformString(_:)](system/filepath/component/withplatformstring(_:).md)

### Enumerations

- [FilePath.Component.Kind](system/filepath/component/kind-swift.enum.md)

### Default Implementations

- [CustomDebugStringConvertible Implementations](system/filepath/component/customdebugstringconvertible-implementations.md)
- [CustomStringConvertible Implementations](system/filepath/component/customstringconvertible-implementations.md)
- [ExpressibleByStringLiteral Implementations](system/filepath/component/expressiblebystringliteral-implementations.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [ExpressibleByExtendedGraphemeClusterLiteral](swift/expressiblebyextendedgraphemeclusterliteral.md)
- [ExpressibleByStringLiteral](swift/expressiblebystringliteral.md)
- [ExpressibleByUnicodeScalarLiteral](swift/expressiblebyunicodescalarliteral.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
