For the complete documentation index, see llms.txt. This page is also available as Markdown.

Copy to Clipboard

Introduction

CopyToClipboard widget allows you to wrap your widgets (Editor, Text, TextArea, or Input) and str text with a copy button. This enables you to easily obtain the value of the wrapped content and copy it to your clipboard.

Function signature

CopyToClipboard(
    content="", 
    widget_id=None
)
default

Parameters

Parameters
Type
Description

content

Union[Editor, Text, TextArea, Input, str]

CopyToClipboard content

widget_id

str

Id of the widget

content

Determine input CopyToClipboard content.

type: Union[Editor, Text, TextArea, Input, str]

default value: ""

content

widget_id

ID of the widget.

type: str

default value: None

Methods and attributes

Attributes and Methods
Description

get_content()

Return wrapped content (i.e. widget or str)

Mini App Example

You can find this example in our Github repository:

supervisely-ecosystem/ui-widgets-demos/text elements/004_copy_to_clipboard/src/main.py

Import libraries

Init API client

First, we load environment variables with credentials and init API for communicating with Supervisely Instance:

Initialize different inputs

Create app layout

Prepare a layout for an app using Card widget with the content parameter and place widget that we've just created in the Container widget.

Create an app using a layout

Create an app object with a layout parameter.

layout

Last updated