Icons#
- class FontIcon(icon: str | None = None, color: str | None = None, background: str | None = None, **kwargs: Any)[source]#
Bases:
BlockRender a font-based Bootstrap icon, for example:
<i class="bi-star"></i>
See the Boostrap Icons list for the list of icons. Find an icon you like, and use the name of that icon on that page as the
iconkwarg to the constructor, or set it as theiconclass variable.Example
from wildewidgets import FontIcon icon = FontIcon(icon="star")
- Keyword Arguments:
icon – the name of the icon to render, from the Bootstrap Icons list
color – use this as Tabler color name to use as the foreground font color, leaving the background transparent. If
backgroundis also set, this is ignored. Look at Tabler: Colors for your choices; set this to the text after thebg-background –
use this as Tabler background/foreground color set for this icon. : This overrides
color. Look at Tabler: Colors for your choices; set this to the text after thebg-
- background: str | None = None#
If not
None, use this as Tabler background/foreground color set for this icon. : This overridescolor. Look at Tabler: Colors for your choices; set this to the text after thebg-
- block: str = 'fonticon'#
block is the official wildewidgets name of the block; it can’t be changed by constructor kwargs
- class TablerFontIcon(icon: str | None = None, color: str | None = None, background: str | None = None, **kwargs: Any)[source]#
Bases:
FontIconFontIconfor Tabler Icons.You must include the Tabler Icons CSS in your HTML template:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/icons@latest/iconfont/tabler-icons.min.css">
Example
from wildewidgets import TablerFontIcon icon = TablerFontIcon(icon="star")
- class TablerMenuIcon(icon: str | None = None, color: str | None = None, background: str | None = None, **kwargs: Any)[source]#
Bases:
FontIconA Tabler menu specific icon. This just adds some menu specific classes and uses a
<span>instead of a<i>. It is used bywildewidgets.NavItem,wildewidgets.NavDropdownItemandwildewidgets.DropdownItemobjects.Typically, you won’t use this directly, but instead it will be created for you from a
wildewdigets.MenuItemspecification whenwildewdigets.MenuItem.iconis notNone.Example
from wildewidgets import NavItem, DropdownItem, NavDropdownItem from wildewidgets import TablerMenuIcon icon = TablerMenuIcon(icon='target') item = NavItem(text='Page', url='/page', icon=icon) item2 = DropdownItem(text='Page', url='/page', icon=icon) item3 = NavDropdownItem(text='Page', url='/page', icon=icon)