Skip to content

Commit

Permalink
docs: add iconify docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Jan 5, 2025
1 parent 03978cc commit 646cb4e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 7 deletions.
36 changes: 36 additions & 0 deletions docs/utilities/iconify.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# QIconifyIcon

[Iconify](https://iconify.design/) is an icon library that includes 150,000+
icons from most major icon sets including Bootstrap, FontAwesome, Material
Design, and many more; each available as individual SVGs. Unlike the
[`superqt.fonticon` module](./fonticon.md), `superqt.QIconifyIcon` does not require any additional
dependencies or font files to be installed. Icons are downloaded (and cached)
on-demand from the Iconify API, using [pyconify](https://github.com/pyapp-kit/pyconify)

Search availble icons at <https://icon-sets.iconify.design>
Once you find one you like, use the key in the format `"prefix:name"` to create an
icon: `QIconifyIcon("bi:bell")`.

## Basic Example

```python
from qtpy.QtCore import QSize
from qtpy.QtWidgets import QApplication, QPushButton

from superqt import QIconifyIcon

app = QApplication([])

btn = QPushButton()
btn.setIcon(QIconifyIcon("fluent-emoji-flat:alarm-clock"))
btn.setIconSize(QSize(60, 60))
btn.show()

app.exec()
```

{{ show_widget(225) }}

::: superqt.QIconifyIcon
options:
heading_level: 3
6 changes: 6 additions & 0 deletions docs/utilities/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
| [`IconOpts`](./fonticon.md#superqt.fonticon.IconOpts) | Options for rendering an icon |
| [`Animation`](./fonticon.md#superqt.fonticon.Animation) | Base class for adding animations to a font-icon. |

## SVG Icons

| Object | Description |
| ----------- | --------------------- |
| [`QIconifyIcon`](./iconify.md) | QIcons backed by the [Iconify](https://iconify.design/) icon library. |

## Threading tools

| Object | Description |
Expand Down
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ markdown_extensions:
- attr_list
- md_in_html
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- toc:
permalink: "#"

Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ dev = [
"types-Pygments",
]
docs = [
"mkdocs-macros-plugin",
"mkdocs-material",
"mkdocstrings[python]",
"pint",
"cmap",
"mkdocs-macros-plugin ==1.3.7",
"mkdocs-material ==9.5.49",
"mkdocstrings ==0.27.0",
"mkdocstrings-python ==1.13.0",
"superqt[font-fa5, cmap, quantity]",
]
quantity = ["pint"]
cmap = ["cmap >=0.1.1"]
Expand Down

0 comments on commit 646cb4e

Please sign in to comment.