<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSScroller/scrollerWidth(for:scrollerStyle:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSScroller(cm)scrollerWidthForControlSize:scrollerStyle:"
  },
  "title" : "scrollerWidth(for:scrollerStyle:)"
}
-->

# scrollerWidth(for:scrollerStyle:)

Returns the width for scrollers of the receiving class for a given control size and scroller style.

```
class func scrollerWidth(for controlSize: NSControl.ControlSize, scrollerStyle: NSScroller.Style) -> CGFloat
```

## Parameters

`controlSize`

A control size.

`scrollerStyle`

A scroller style.

## Return Value

The width for scrollers of the receiving class for `controlSize` and `scrollerStyle`.

## Discussion

You should use this method in preference to [`scrollerWidthForControlSize:`](/documentation/AppKit/NSScroller/scrollerWidthForControlSize:), which assumes a scroller style of [`NSScroller.Style.legacy`](/documentation/AppKit/NSScroller/Style/legacy), and [`scrollerWidth`](/documentation/AppKit/NSScroller/scrollerWidth) which in addition assumes a control size of [`NSRegularControlSize`](/documentation/AppKit/NSRegularControlSize).

---

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)