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

# showsBorderOnlyWhileMouseInside

A Boolean value that determines whether the button displays its border only when the pointer is over it.

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

## Discussion

The value of this property is <doc://com.apple.documentation/documentation/Swift/true> if the button’s border is displayed only when the pointer is over the button and the button is active. The value is <doc://com.apple.documentation/documentation/Swift/false> if the border is displayed all the time, regardless of the position of the pointer. By default, this method returns <doc://com.apple.documentation/documentation/Swift/false>.

If [`isBordered`](/documentation/AppKit/NSButton/isBordered) is <doc://com.apple.documentation/documentation/Swift/false>, the border is never displayed, regardless of the value of [`showsBorderOnlyWhileMouseInside`](/documentation/AppKit/NSButton/showsBorderOnlyWhileMouseInside).

---

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)