<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISlider/thumbRect(forBounds:trackRect:value:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISlider(im)thumbRectForBounds:trackRect:value:"
  },
  "title" : "thumbRect(forBounds:trackRect:value:)"
}
-->

# thumbRect(forBounds:trackRect:value:)

Returns the drawing rectangle for the slider’s thumb image.

```
func thumbRect(forBounds bounds: CGRect, trackRect rect: CGRect, value: Float) -> CGRect
```

## Parameters

`bounds`

The bounding rectangle of the slider.

`rect`

The drawing rectangle for the slider’s track, as returned by the [`trackRect(forBounds:)`](/documentation/UIKit/UISlider/trackRect(forBounds:)) method.

`value`

The current value of the slider.

## Return Value

The computed drawing rectangle for the thumb image.

## Discussion

You do not call this method directly. Instead, you override it when you want to customize the thumb image’s drawing rectangle, returning a different rectangle. The rectangle you return must reflect the size of your thumb image and its current position on the slider’s track.

---

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)