diff --git a/CHANGELOG.md b/CHANGELOG.md index c5466265ac..2b26cfc8ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Upcoming Release ## New Features: -No changes to highlight. +* Added `title` argument to `TabbedInterface` by @MohamedAliRashad in [#2888](https://github.com/gradio-app/gradio/pull/2888) ## Bug Fixes: * Fixed bug where setting `default_enabled=False` made it so that the entire queue did not start by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2876](https://github.com/gradio-app/gradio/pull/2876) diff --git a/gradio/interface.py b/gradio/interface.py index 37199fbbee..eac55e064e 100644 --- a/gradio/interface.py +++ b/gradio/interface.py @@ -726,6 +726,7 @@ class TabbedInterface(Blocks): self, interface_list: List[Interface], tab_names: Optional[List[str]] = None, + title: Optional[str] = None, theme: str = "default", analytics_enabled: Optional[bool] = None, css: Optional[str] = None, @@ -734,6 +735,7 @@ class TabbedInterface(Blocks): Parameters: interface_list: a list of interfaces to be rendered in tabs. tab_names: a list of tab names. If None, the tab names will be "Tab 1", "Tab 2", etc. + title: a title for the interface; if provided, appears above the input and output components in large font. Also used as the tab title when opened in a browser window. theme: which theme to use - right now, only "default" is supported. analytics_enabled: whether to allow basic telemetry. If None, will use GRADIO_ANALYTICS_ENABLED environment variable or default to True. css: custom css or path to custom css file to apply to entire Blocks @@ -741,6 +743,7 @@ class TabbedInterface(Blocks): a Gradio Tabbed Interface for the given interfaces """ super().__init__( + title=title, theme=theme, analytics_enabled=analytics_enabled, mode="tabbed_interface", @@ -749,6 +752,12 @@ class TabbedInterface(Blocks): if tab_names is None: tab_names = ["Tab {}".format(i) for i in range(len(interface_list))] with self: + if title: + Markdown( + "

" + + title + + "

" + ) with Tabs(): for (interface, tab_name) in zip(interface_list, tab_names): with TabItem(label=tab_name):