Skip to content

Commit 56beb71

Browse files
committed
IconButton remove variant and add size property
1 parent 3c9fe4f commit 56beb71

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

chartlets.py/chartlets/components/button.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Button(Component):
2424
"""
2525

2626
variant: str | None = None
27-
"""The button variant.
27+
"""The button variant.
2828
One "contained" | "outlined" | "text". Defaults to "text".
2929
"""
3030

@@ -49,10 +49,10 @@ class IconButton(Component):
4949
"info" | "warning". Defaults to "primary".
5050
"""
5151

52-
variant: str | None = None
53-
"""The button variant.
54-
One "contained" | "outlined" | "text". Defaults to "text".
55-
"""
56-
5752
tooltip: str | None = None
5853
"""Tooltip title. Optional."""
54+
55+
size: str | None = None
56+
"""The button size.
57+
One of "small" | "medium" | "large". Defaults to "medium".
58+
"""

chartlets.py/demo/my_extension/my_panel_5.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
def render_panel(
1313
ctx: Context,
1414
) -> Component:
15-
open_button = Button(id="open_button", text="Open Dialog", startIcon="ChatBubble")
15+
open_button = Button(
16+
id="open_button",
17+
text="Open Dialog",
18+
startIcon="ChatBubble",
19+
variant="outlined",
20+
color="warning",
21+
)
1622
okay_button = Button(id="okay_button", text="Okay")
1723
not_okay_button = Button(id="not_okay_button", text="Not okay")
1824
dialog = Dialog(

0 commit comments

Comments
 (0)