> For the complete documentation index, see [llms.txt](https://sdk-doc.tyrads.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sdk-doc.tyrads.com/android-beta/initialization/premium-offers.md).

# Premium Offers

### TopPremiumOffers Composable Function

#### Overview

The `TopPremiumOffers` composable function is designed to display top premium offers within the application. It utilizes the `TopOffers` composable to render the offers with specific settings.

#### Parameters:

* The `context` parameter is required and should be the context of the widget that will display the top offers widget.
* The `widgetStyle` parameter is used to choose the style of the widget. The default style is `PremiumWidgetStyles.LIST`, which displays the offers in a list. Other available style is `PremiumWidgetStyles.SLIDER_CARDS`, which displays the offers in a slider.

**Available Widget Style options**

<figure><img src="/files/pmkTkVXEfP8BjgHKJ7SK" alt=""><figcaption><p> Slider Cards</p></figcaption></figure>

<figure><img src="/files/zMADmZXKS3LZtzT4sJkN" alt=""><figcaption><p>List View </p></figcaption></figure>

Return Value:

* `Widget`: A Composable `Widget` that can be embedded in your application's UI.

#### Usage

To use this composable, you can call it through the `Tyrads` instance like this:

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
// Kotlin (Direct Jetpack Compose)
import androidx.compose.runtime.Composable
import com.tyrads.sdk.Tyrads

@Composable
fun MyCustomLayout() {
    // Renders the Tyrads Premium Offer widget natively
    Tyrads.getInstance().TopPremiumOffers(
        widgetStyle = Tyrads.PremiumWidgetStyles.LIST // Or Tyrads.PremiumWidgetStyles.SLIDER_CARDS
    )
}
```

{% endtab %}

{% tab title="Java" %}

```java
// Java Implementation (Instantiating dynamically via TyradsViewHelper)
import android.os.Bundle;
import android.widget.LinearLayout;
import androidx.appcompat.app.AppCompatActivity;
import com.tyrads.sdk.acmo.helpers.TyradsViewHelper;
import com.tyrads.sdk.acmo.modules.premium_widgets.TopPremiumOffersView;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        LinearLayout container = findViewById(R.id.widget_container);

        // Dynamically instantiate the view using the built-in helper
        TopPremiumOffersView premiumOffersView = TyradsViewHelper.createTopPremiumOffersView(
            this,                 // Context
            true,                 // showMore
            false,                // showMyOffers
            false,                // showMyOffersEmptyView
            1                     // style (0 = SLIDER_CARDS, 1 = LIST)
        );

        container.addView(premiumOffersView);
    }
}
```

{% endtab %}

{% tab title="XML" %}

```xml
<!-- XML Layout Integration (Available for both Kotlin & Java) -->
<com.tyrads.sdk.acmo.modules.premium_widgets.TopPremiumOffersView
    android:id="@+id/premium_offers_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:showMore="true"
    app:showMyOffers="false"
    app:showMyOffersEmptyView="false"
    app:style="1" /> <!-- 0 = SLIDER_CARDS, 1 = LIST -->
```

{% endtab %}
{% endtabs %}
