add Icon to shoelace components

This commit is contained in:
Fabio Pliger
2024-01-31 16:24:51 -06:00
parent ff19d637ec
commit a9057e4cea
2 changed files with 16 additions and 1 deletions

View File

@@ -236,6 +236,17 @@ class Card(TextShoeBase):
self.add_class('card-overview')
class Icon(ShoeBase):
tag = 'sl-icon'
name = js_property('name')
src = js_property('src')
label = js_property('label')
library = js_property('library')
update_complete = js_property('updateComplete')
def __init__(self, name=None, src=None, label=None, library=None, style=None, **kwargs):
super().__init__(name=name, src=src, label=label, library=library, style=style, **kwargs)
# ************* EXAMPLES SECTION *************
@@ -261,6 +272,10 @@ examples = {
"instance": Alert("This is a standard alert. You can customize its content and even the icon."),
"code": el.code("Alert('This is a standard alert. You can customize its content and even the icon.'"),
},
'Icon': {
"instance": Icon(name="heart"),
"code": el.code('Icon(name="heart")'),
},
'Button': {
"instance": Button("Try me"),
"code": el.code('Button("Try me")'),