# .NET MAUI SmartPasteButton Provider, Text, Icon, and Template Configuration

The SmartPasteButton control provides configuration options for setting the smart paste provider, customizing the button text and icon, and adjusting its control template.

## Setting Provider

The `Provider` property specifies the smart paste provider that supplies fields and handles value assignment for the smart paste operation. Typically, this would be set to a container view (like a `Form` or `Layout`) that implements `Telerik.Maui.Controls.SmartPasteButton.ISmartPasteButtonProvider`.

By default, the SmartPasteButton has a built-in integration with the DataForm control. When the SmartPasteButton's `Provider` property references the DataForm instance, it allows the SmartPasteButton to extract structured information from the clipboard content and populate the corresponding fields in the DataForm based on the form structure.

## Setting Text

The `Text` property of the SmartPasteButton allows you to set the button's display text.

To customize the appearance of the text, you can use the following properties:

* `TextColor` (`Color`)—Specifies the color of the text.
* `TextDecoration` (`TextDecorations`)—Specifies the text decorations (underline, strikethrough, or both) applied to the text.
* `FontFamily` (`string`)—Specifies the font family of the text.
* `FontSize` (`double`)—Specifies the size of the text.
* `FontAttributes` (`FontAttributes`)—Specifies the font attributes (bold, italic, or both) applied to the text.

## Setting Icon

The `IconText` property allows you to set an icon to the button's icon element.

To configure the appearance of the icon, you can use the following properties:

* `IconTextColor` (`Color`)—Specifies the color of the icon.
* `IconFontFamily` (`string`)—Specifies the font family of the icon.
* `IconFontSize` (`double`)—Specifies the size of the icon.
* `IconFontAttributes` (`FontAttributes`)—Specifies the font attributes (bold, italic, or both) applied to the icon.

## Customizing Control Template

The SmartPasteButton control template consists of a `Border` element that contains a `StackLayout` with two children: a `Label` for the icon and a `Label` for the text.

You can customize the control template to change the layout or add additional elements as needed.

This is an example of how to define a custom control template for the SmartPasteButton:

```XAML
<telerik:RadSmartPasteButton Provider="{x:Reference dataForm}"
                             HorizontalOptions="Start"
                             Text="Smart Paste From Clipboard"
                             SmartPasteRequest="OnSmartPasteRequest">
    <telerik:RadSmartPasteButton.ControlTemplate>
        <ControlTemplate>
            <telerik:RadEffectsView x:Name="PART_EffectsView"
                                    BackgroundColor="{TemplateBinding BackgroundColor}"
                                    Background="{TemplateBinding Background}"
                                    BorderColor="{TemplateBinding BorderColor}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="{TemplateBinding CornerRadius, Converter={x:Static telerik:CornerRadiusToThicknessConverter.Instance}}"
                                    Padding="{TemplateBinding Padding}">
                <HorizontalStackLayout Spacing="8"
                                       HorizontalOptions="Center"
                                       VerticalOptions="Center">
                    <telerik:RadPath Fill="#00897B"
                                     StrokeThickness="0"
                                     WidthRequest="24"
                                     HeightRequest="24"
                                     VerticalOptions="Center"
                                     Geometry="{x:Static telerik:RadGeometry.Star}" />
                    <Label Text="{TemplateBinding Text}"
                           TextColor="{TemplateBinding TextColor}"
                           FontFamily="{TemplateBinding FontFamily}"
                           FontSize="{TemplateBinding FontSize}"
                           FontAttributes="{TemplateBinding FontAttributes}"
                           VerticalTextAlignment="Center" />
                </HorizontalStackLayout>
            </telerik:RadEffectsView>
        </ControlTemplate>
    </telerik:RadSmartPasteButton.ControlTemplate>
</telerik:RadSmartPasteButton>
```

And the result:

![.NET MAUI SmartPasteButton Control Template](https://www.telerik.com/maui-ui/documentation/assets/57bd3d686ef1d40ce5848c768f2ea7f4/smartpastebutton-template.png)

> For a runnable example demonstrating the SmartPasteButton styling options, see the [SDKBrowser Demo Application](https://www.telerik.com/maui-ui/documentation/demos-and-sample-apps/sdkbrowser-app) and go to the **SmartPasteButton > Template** category.

## See Also

* [Styling the SmartPasteButton](https://www.telerik.com/maui-ui/documentation/controls/smartpastebutton/styling)
* [Visual States of the SmartPasteButton](https://www.telerik.com/maui-ui/documentation/controls/smartpastebutton/visual-states)
* [Events of the SmartPasteButton](https://www.telerik.com/maui-ui/documentation/controls/smartpastebutton/events)
* [Commanding with the SmartPasteButton](https://www.telerik.com/maui-ui/documentation/controls/smartpastebutton/command)
