> For the complete documentation index, see [llms.txt](https://developer.supervisely.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.supervisely.com/app-development/widgets/thumbnails/projectthumbnail.md).

# ProjectThumbnail

## Introduction

**`ProjectThumbnail`** widget in Supervisely is a widget that allows to display a thumbnail image that represents supervisely project. It is a useful widget for applications that run from specific project, allowing users to have quick access to this project, so that when the user clicks on the thumbnail, the link will take him to this project.

## Function signature

```python
ProjectThumbnail(info=None, widget_id=None)
```

<figure><img src="https://user-images.githubusercontent.com/120389559/217830022-e16f1cac-83e6-4caf-aa1b-097116b68058.png" alt=""><figcaption></figcaption></figure>

## Parameters

|    Parameters    |      Type     |                     Description                    |
| :--------------: | :-----------: | :------------------------------------------------: |
|      `info`      | `ProjectInfo` | `NamedTuple`, containing information about project |
| `remove_margins` |     `bool`    |    Set margins to 0 to make widget more compact    |
|    `widget_id`   |     `str`     |                  ID of the widget                  |

### info

`NamedTuple`, containing information about project.

**type:** `ProjectInfo`

**default value:** `None`

```python
project = api.project.get_info_by_id(project_id)
project_thumbnail = ProjectThumbnail(project)
```

### remove\_margins

Set margins to 0 to make widget more compact.

**type:** `bool`

**default value:** `False`

```python
project_thumbnail = ProjectThumbnail(project, remove_margins=True)
```

### widget\_id

ID of the widget.

**type:** `str`

**default value:** `None`

### Methods and attributes

|  Attributes and Methods  | Description             |
| :----------------------: | ----------------------- |
| `set(info: ProjectInfo)` | Set input project data. |

## Mini App Example

You can find this example in our Github repository:

[ui-widgets-demos/thumbnail/001\_project\_thumbnail/src/main.py](https://github.com/supervisely-ecosystem/ui-widgets-demos/blob/master/thumbnail/001_project_thumbnail/src/main.py)

#### Import libraries

```python
import os

import supervisely as sly
from dotenv import load_dotenv
from supervisely.app.widgets import Card, Container, ProjectThumbnail
```

### Init API client

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

```python
load_dotenv("local.env")
load_dotenv(os.path.expanduser("~/supervisely.env"))

api = sly.Api()
```

### Get Project ID and info

```python
project_id = sly.env.project_id()
project = api.project.get_info_by_id(project_id)
```

### Initialize `ProjectThumbnail` widget

```python
project_thumbnail = ProjectThumbnail(project)
```

### 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.

```python
# create new cards
card = Card(
    title="Project Thumbnail",
    content=Container(widgets=[project_thumbnail]),
)

layout = Container(widgets=[card])
```

### Create app using layout

Create an app object with layout parameter.

```python
app = sly.Application(layout=layout)
```

<figure><img src="https://user-images.githubusercontent.com/120389559/217830022-e16f1cac-83e6-4caf-aa1b-097116b68058.png" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.supervisely.com/app-development/widgets/thumbnails/projectthumbnail.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
