# SizeGuideView (Views)

> The same button as an Android View: set client and product.

Source: https://docs.tryyoursize.com/reference/android/size-guide-view/

*Component* · `com.tryyoursize:tryyoursize-android`

The same button as an Android `View`: set `client` and `product`.

## Parameters

- **`context`** (`Context`, required)
- **`attrs`** (`AttributeSet?`, optional, default `null`)
- **`defStyleAttr`** (`Int`, optional, default `0`)

## Properties

- **`client`** (`TryYourSize?`, required): Your client.
- **`product`** (`String?`, required): Your product ID or SKU.
- **`variant`** (`SizeGuideVariant`, required): `LINK` (default) or `BUTTON`.
- **`label`** (`String?`, required): Your own words instead of "Size guide".
- **`onRecommendation`** (`((Recommendation) -> Unit)?`, required): The shopper's recommended size, on show and on every change.

## Example

**Kotlin**

```kotlin
// Views
val guide = SizeGuideView(context).apply {
    client = tys
    product = "SKU-123"
    variant = SizeGuideVariant.BUTTON
    onRecommendation = { rec -> /* … */ }
}
```

**Swift**

```swift
// UIKit
let guide = SizeGuideButton(client: tys, product: "SKU-123", variant: .button)
guide.onRecommendation = { rec in /* … */ }
stack.addArrangedSubview(guide)
```
