Icons#
- class FontIcon(icon: Optional[str] = None, color: Optional[str] = None, background: Optional[str] = None, **kwargs)[source]#
Bases:
Block
Render 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
icon
kwarg to the constructor, or set it as theicon
class variable.- 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
background
is 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: Optional[str] = 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: Optional[str] = None, color: Optional[str] = None, background: Optional[str] = None, **kwargs)[source]#
Bases:
FontIcon
FontIcon
for Tabler Icons.Requires:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/icons@latest/iconfont/tabler-icons.min.css">
- class TablerMenuIcon(icon: Optional[str] = None, color: Optional[str] = None, background: Optional[str] = None, **kwargs)[source]#
Bases:
FontIcon
A 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.NavDropdownItem
andwildewidgets.DropdownItem
objects.Typically, you won’t use this directly, but instead it will be created for you from a
wildewdigets.MenuItem
specification whenwildewdigets.MenuItem.icon
is notNone
.Example
>>> 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)