# PasteButton The **\** security component allows you to obtain temporary pasteboard permission from the user by their touching the component. > **NOTE** > > This component is supported since API version 10. Updates will be marked with a superscript to indicate their earliest API version. ## Child Components Not supported ## APIs ### PasteButton PasteButton() Creates a Paste button with an icon, text, and background. You may want to learn the [restrictions on security component styles](../../../security/AccessToken/security-component-overview.md#constraints) to avoid authorization failures caused by incompliant styles. **Atomic service API**: This API can be used in atomic services since API version 11. **System capability**: SystemCapability.ArkUI.ArkUI.Full ### PasteButton PasteButton(option:PasteButtonOptions) Creates a Paste button that contains the specified elements. You may want to learn the [restrictions on security component styles](../../../security/AccessToken/security-component-overview.md#constraints) to avoid authorization failures caused by incompliant styles. **Atomic service API**: This API can be used in atomic services since API version 11. **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | option | [PasteButtonOptions](#pastebuttonoptions) | No| Options for creating the Paste button.
Default value:
{
icon: PasteIconStyle.LINES,
text: PasteDescription.PASTE,
buttonType: ButtonType.Capsule
} | ## PasteButtonOptions **Atomic service API**: This API can be used in atomic services since API version 11. **System capability**: SystemCapability.ArkUI.ArkUI.Full | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | icon | [PasteIconStyle](#pasteiconstyle) | No| Icon style of the Paste button.
If this parameter is not specified, no icon is contained. Either **icon** or **text**, or both, must be set.| | text | [PasteDescription](#pastedescription) | No| Text on the Paste button.
If this parameter is not specified, no text is contained. Either **icon** or **text**, or both, must be set.| | buttonType | [ButtonType](ts-basic-components-button.md#buttontype) | No| Background type of the Paste button.
If this parameter is not specified, the system uses a capsule-type button.| ## Attributes This component can only inherit the [universal attributes of security components](ts-securitycomponent-attributes.md#attributes) ## PasteIconStyle **Atomic service API**: This API can be used in atomic services since API version 11. **System capability**: SystemCapability.ArkUI.ArkUI.Full | Name| Value| Description| | -------- | -------- | -------- | | LINES | 0 | Line style icon.| ## PasteDescription **Atomic service API**: This API can be used in atomic services since API version 11. **System capability**: SystemCapability.ArkUI.ArkUI.Full | Name| Value| Description| | -------- | -------- | -------- | | PASTE | 0 | The text on the Paste button is **Paste**.| ## PasteButtonOnClickResult **Atomic service API**: This API can be used in atomic services since API version 11. **System capability**: SystemCapability.ArkUI.ArkUI.Full | Name| Value| Description| | -------- | -------- | -------- | | SUCCESS | 0 | The Paste button is touched successfully.| | TEMPORARY_AUTHORIZATION_FAILED | 1 | Temporary authorization fails after the Paste button is touched.| ## Events Only the following events are supported. ### onClick onClick(event: (event: ClickEvent, result: PasteButtonOnClickResult) => void) Called when a click event occurs. **Atomic service API**: This API can be used in atomic services since API version 11. **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** | Name| Type | Mandatory| Description | |------------|------|-------|---------| | event | [ClickEvent](ts-universal-events-click.md#clickevent) |Yes|See **ClickEvent**.| | result | [PasteButtonOnClickResult](#pastebuttononclickresult)| Yes| Authorization result. After the authorization, the pasteboard content can be read.| ## Example ```ts // xxx.ets @Entry @Component struct Index { build() { Row() { Column({space:10}) { // Create a default button with an icon, text, and background. PasteButton().onClick((event: ClickEvent, result: PasteButtonOnClickResult)=>{ console.info("result " + result) }) // Whether an element is contained depends on whether the parameter corresponding to the element is specified. If buttonType is not passed in, the button uses the ButtonType.Capsule settings. PasteButton({icon:PasteIconStyle.LINES}) // Create a button with only an icon and background. If the alpha value of the most significant eight bits of the background color is less than 0x1A, the system forcibly adjusts the alpha value to 0xFF. PasteButton({icon:PasteIconStyle.LINES, buttonType:ButtonType.Capsule}) .backgroundColor(0x10007dff) // Create a button with an icon, text, and background. If the alpha value of the most significant eight bits of the background color is less than 0x1A, the system forcibly adjusts the alpha value to 0xFF. PasteButton({icon:PasteIconStyle.LINES, text:PasteDescription.PASTE, buttonType:ButtonType.Capsule}) }.width('100%') }.height('100%') } } ``` ![en-us_image_0000001593677984](figures/en-us_image_0000001593677984.png)