<!--
{
  "availability" : [
    "macOS: 10.11.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSearchField/centersPlaceholder",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSearchField(py)centersPlaceholder"
  },
  "title" : "centersPlaceholder"
}
-->

# centersPlaceholder

A Boolean value that determines whether the search field’s components are centered within the control.

```
var centersPlaceholder: Bool { get set }
```

## Discussion

When this property is set to <doc://com.apple.documentation/documentation/Swift/true>, the search field’s components become centered within the control if the field is empty and doesn’t have focus. If the field is empty when receiving focus, the centered objects animate to the edges of the control. When this property is set to <doc://com.apple.documentation/documentation/Swift/false>, the components are always at the edge. The default value is <doc://com.apple.documentation/documentation/Swift/true>.

> Note:
> When set to <doc://com.apple.documentation/documentation/Swift/true>, ``doc://com.apple.appkit/documentation/AppKit/NSView/wantsLayer`` is also <doc://com.apple.documentation/documentation/Swift/true>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)