mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 11:15:36 -05:00
add Icon to shoelace components
This commit is contained in:
@@ -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")'),
|
||||
|
||||
Reference in New Issue
Block a user