# `GSComponent.alignment`

*Instance Property*

The policy for automatic positioning.

## Declaration

```swift
var alignment: GSComponent.Alignment { get set }
```

```objc
@property (nonatomic) GSComponentAlignment alignment;
```

[See also `alignment` in the Python API](https://docu.glyphsapp.com/#GSComponent.alignment)

```python
pyobjc_instanceMethods.alignment() -> GSComponentAlignment
pyobjc_instanceMethods.setAlignment_(alignment: GSComponentAlignment)
```

## Discussion

- `GSAlignmentDefault` follows normal alignment and attachment eligibility.
- `GSAlignmentDisable` disables both.
- `GSAlignmentForce` overrides normal alignment eligibility.
- `GSAlignmentHorizontal` uses normal eligibility but restricts base-glyph alignment to the horizontal coordinate.

Access [`GSComponent.effectiveAlignment`](/Core/GlyphsCore/GSComponent/effectiveAlignment) for the alignment that is currently applied to the component.

## See Also

### Alignment

- [`GSComponent.GSComponentAlignment`](/Core/GlyphsCore/GSComponent/GSComponentAlignment) — A policy or result of automatically positioning a component.
- [`GSComponent setAlignmentFast:`](/Core/GlyphsCore/GSComponent/setAlignmentFast:) — Sets the automatic-positioning policy without undo, change notifications, or layer updates.
- [`GSComponent.effectiveAlignment`](/Core/GlyphsCore/GSComponent/effectiveAlignment) — The result of the most recent automatic positioning.
- [`GSComponent.alignmentType`](/Core/GlyphsCore/GSComponent/alignmentType) — The coordinate mode used for automatic base-glyph alignment.
- [`GSComponent.doesAlign`](/Core/GlyphsCore/GSComponent/doesAlign) — Whether the component participates in automatic base-glyph alignment under the current policy.
- [`GSComponent.shouldAlign`](/Core/GlyphsCore/GSComponent/shouldAlign) — Whether the component and containing glyph normally qualify for automatic base-glyph alignment.
- [`GSComponent enableAlignment`](/Core/GlyphsCore/GSComponent/enableAlignment) — Enables automatic positioning.

