Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions solara/lab/components/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def MenuWidget(
context: bool = False,
use_absolute: bool = True,
use_activator_width: bool = True,
offset_y: bool = True,
offset_x: bool = False,
):
pass

Expand Down Expand Up @@ -133,6 +135,8 @@ def Menu(
children: List[solara.Element] = [],
style: Optional[Union[str, Dict[str, str]]] = None,
use_activator_width: bool = True,
offset_x: bool = False,
offset_y: bool = True,
):
"""
Show a pop-up menu by clicking on the `activator` element. The menu appears below the `activator` element.
Expand Down Expand Up @@ -160,6 +164,8 @@ def Page():
* style: CSS style to apply. Applied directly onto the `v-menu` component.
* use_activator_width: If True, the menu will have a minimum width equal to the activator element.
If False, the menu width will be determined by the content.
* offset_x: If True, the menu will be offset from the activator element in the x direction.
* offset_y: If True, the menu will be offset from the activator element in the y direction.
"""
open_reactive = solara.use_reactive(open_value, on_open_value)
del open_value
Expand All @@ -178,4 +184,6 @@ def Page():
style=style_flat,
use_absolute=False,
use_activator_width=use_activator_width,
offset_x=offset_x,
offset_y=offset_y,
)
3 changes: 2 additions & 1 deletion solara/lab/components/menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<v-menu
v-model="show_menu"
:absolute="use_absolute"
offset-y
:offset-y="offset_y"
:offset-x="offset_x"
:close-on-content-click="close_on_content_click"
:min-width="use_activator_width ? null : 'auto'"
>
Expand Down