# Icons

> API reference for pyzed.icons: the bundled Lucide icon set, icon names and file-type icon utilities for Python desktop interfaces.

Source: https://albakore.github.io/pyzed/reference/icons/

<!-- Generated by docs/scripts/gen_api.py. Edit docs/scripts/api_docs_en.py. -->

Pyzed bundles the [Lucide](https://lucide.dev) font (ISC license) with about 2000 icons.
Search names with `pyzed icons <filter>` or on the Lucide website.

## pyzed.icons

### `icon`

```python
icon(name, *, size=16, color=None)
```

An icon widget. Also available as `pyzed.icon`.

| Parameter | Description |
| --- | --- |
| `name` | Icon name. |
| `size` | Size. |
| `color` | Color (defaults to the text color). |

### `glyph`

```python
glyph(name)
```

Returns an icon's character, to use in any text with `font="icons"`. Raises `ValueError` if it doesn't exist.

| Parameter | Description |
| --- | --- |
| `name` | Icon name. |

### `names`

```python
names()
```

Sorted list of all icon names.

### `search`

```python
search(query, among=None)
```

Icons matching a search by name and tag, best first: exact names, then names that start with the query, names with every word and icons found by their tags (`search("person")` finds `user`).

| Parameter | Description |
| --- | --- |
| `query` | Words that must all appear in the name or the tags. |
| `among` | Only search these names (default: every icon). |

```python
icons.search("arrow up")[:3]  # ["arrow-up", "arrow-up-01", "arrow-up-10"]
```

### `tags`

```python
tags(name)
```

The search tags of an icon, from Lucide (`tags("user")` is `["person", "account", "contact"]`).

| Parameter | Description |
| --- | --- |
| `name` | Icon name. |

### `category`

```python
category(key, among=None)
```

The icons of a category of `CATEGORIES`, sorted. An icon can be in several.

| Parameter | Description |
| --- | --- |
| `key` | A key of `CATEGORIES` (`"arrows"`, `"files"`, `"people"`...). |
| `among` | Only look at these names. |

### `CATEGORIES`

Groups for browsing icons (arrows, text, files, layout, media, communication, people, devices, development, shapes, weather, commerce, maps, status), each with the words of names and tags that put an icon in it.

### `for_file`

```python
for_file(name)
```

Returns `(icon, color_or_None)` for a file name, as in the project panel of a code editor.

| Parameter | Description |
| --- | --- |
| `name` | File name. |

### `language_for`

```python
language_for(name)
```

Human-readable language name of a file (`"main.py"` → `"Python"`), handy for the status bar.

| Parameter | Description |
| --- | --- |
| `name` | File name. |
