MembersListPreview

Introduction

Members List Preview widget simply displays a list of members. It can be used to display members that were selected by the user in the Members List Selector widget for example.

Function signature

members_list_preview = MembersListPreview(
    users=members,
    max_width=300,
    empty_text=None,
    widget_id=None,
)
default

Parameters

Parameters
Type
Description

users

List[UserInfo]

Supervisely UserInfo objects

max_width

int

Max width of the widget

empty_text

str

Text that will be displayed when there are no members in widget

widget_id

str

ID of the widget

users

List of UserInfo objects.

type: List[UserInfo]

max_width

Set the maximum width of the widget in pixels.

type: int

default 300

empty_text

Text that will be displayed when there are no members in the widget.

type: str

default None

empty-text

widget_id

ID of the widget.

type: str

default value: None

Methods and attributes

Attributes and Methods
Description

set()

Set users to the widget.

Mini App Example

In this example we will create a mini app with MembersListPreview widget. We will create a MembersListSelector widget and display selected members with MembersListPreview widget.

You can find this example in our Github repository:

supervisely-ecosystem/ui-widgets-demos/media/019_members_list_preview/src/main.py

Import libraries

Init API client

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

Define team ID

Get Team members and initialize MembersListSelector widget

Initialize MembersListPreview widget and Text widget for displaying number of selected members

Create app layout

Prepare a layout for app using Card widget with the content parameter and place widgets that we've previously created into the Container widget.

Create app using layout

Create an app object with layout parameter.

Add functions to control widgets from python code

mini-app-min

Last updated

Was this helpful?