ActivityFeed

Introduction

Activity Feed widget displays a vertical timeline of activity items with status indicators. Each item can contain custom widget content and shows a visual status (completed, in progress, pending, or error). This widget is useful for showing task progress, workflow steps, or sequential operations in applications.

Read this tutorial in developer portal.

[activity-feed

Function signature

ActivityFeed(
    items: Optional[List[ActivityFeed.Item]] = None,
    widget_id: Optional[str] = None,
)

Parameters

Parameters
Type
Description

items

Optional[List[ActivityFeed.Item]]

List of activity items to display

widget_id

Optional[str]

ID of the widget

items

List of ActivityFeed.Item objects representing individual activities.

type: Optional[List[ActivityFeed.Item]]

default value: None

widget_id

ID of the widget.

type: Optional[str]

default value: None

ActivityFeed.Item

Inner class for creating activity feed items.

Function signature

Parameters

Parameters
Type
Description

content

Widget

Widget to display as item content

status

Literal["pending", "in_progress", "completed", "failed"]

Visual status of the activity item

number

Optional[int]

Position number in the feed (auto-assigned if None)

Methods and attributes

Attributes and Methods
Description

add_item()

Add a new item to the activity feed.

remove_item()

Remove an item from the feed by its number.

set_status()

Update the status of an item by its number.

get_status()

Get the status of an item by its number.

get_items()

Get all items in the activity feed.

clear()

Remove all items from the feed.

set_items()

Replace all items in the activity feed.

Mini App Example

You can find this example in our GitHub repository:

supervisely-ecosystem/ui-widgets-demos/status elements/010_activity_feed/src/main.py

Import libraries

Init API client

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

Create activity items with custom content

Create individual activity items with different statuses and custom widget content:

Initialize ActivityFeed widget

Create app layout

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

Create app using layout

Create an app object with layout parameter.

The activity feed will display a vertical timeline showing all activities with their current status indicators. Items with "completed" status show a checkmark, "in_progress" shows a spinner, "pending" shows an empty circle, and "failed" shows an error indicator.

Using methods to control the feed

Last updated

Was this helpful?