# `GSLayer.componentNames`

*Instance Property*

The component names of the direct component shapes.

## Declaration

```swift
var componentNames: [String] { get set }
```

```objc
@property (nonatomic, strong) NSArray<NSString *> * componentNames;
```

```python
componentNames() -> list[str]
setComponentNames_(componentNames: list[str])
```

## Discussion

Setting this property replaces the layer’s shapes with components for the given names.

## See Also

### Component Names

- [`GSLayer.componentNamesTraversingComponents`](/Core/GlyphsCore/GSLayer/componentNamesTraversingComponents) — The component names of direct and nested component shapes.
- [`GSLayer componentNamesTraverseComponents:`](/Core/GlyphsCore/GSLayer/componentNamesTraverseComponents:) — Returns component names, optionally including nested component shapes.

