From 065b1b88d233af0efc6c59a6cd14d7c8d2ce5a23 Mon Sep 17 00:00:00 2001 From: Alek Petuskey Date: Mon, 27 Nov 2023 17:59:35 -0800 Subject: [PATCH] Add index on tabs (#2225) * Add index on tabs --------- Co-authored-by: Alek Petuskey --- reflex/components/disclosure/tabs.py | 3 +++ reflex/components/disclosure/tabs.pyi | 2 ++ 2 files changed, 5 insertions(+) diff --git a/reflex/components/disclosure/tabs.py b/reflex/components/disclosure/tabs.py index 53b7dccce..3071d07e2 100644 --- a/reflex/components/disclosure/tabs.py +++ b/reflex/components/disclosure/tabs.py @@ -44,6 +44,9 @@ class Tabs(ChakraComponent): # The color scheme of the tabs. color_scheme: Var[LiteralColorScheme] + # Index of the selected tab (in controlled mode). + index: Var[int] + @classmethod def create( cls, *children, items: Optional[List[Tuple[str, str]]] = None, **props diff --git a/reflex/components/disclosure/tabs.pyi b/reflex/components/disclosure/tabs.pyi index 71c903cd8..49b02cf78 100644 --- a/reflex/components/disclosure/tabs.pyi +++ b/reflex/components/disclosure/tabs.pyi @@ -106,6 +106,7 @@ class Tabs(ChakraComponent): ], ] ] = None, + index: Optional[Union[Var[int], int]] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -173,6 +174,7 @@ class Tabs(ChakraComponent): orientation: The orientation of the tab list. variant: "line" | "enclosed" | "enclosed-colored" | "soft-rounded" | "solid-rounded" | "unstyled" color_scheme: The color scheme of the tabs. + index: Index of the selected tab (in controlled mode). style: The style of the component. key: A unique key for the component. id: The id for the component.