Skip to content

Add title to TabbedInterface#2888

Merged
abidlabs merged 3 commits into
gradio-app:mainfrom
MohamedAliRashad:main
Dec 27, 2022
Merged

Add title to TabbedInterface#2888
abidlabs merged 3 commits into
gradio-app:mainfrom
MohamedAliRashad:main

Conversation

@MohamedAliRashad
Copy link
Copy Markdown
Contributor

@MohamedAliRashad MohamedAliRashad commented Dec 26, 2022

Fixes: #2882

@abidlabs
Copy link
Copy Markdown
Member

Thanks for opening the PR @MohamedAliRashad. This change passes a title into parent of TabbedInterface, which is Blocks. If you look at the docstring for Blocks, the effect of this change will be to set a title which appears as the "The tab title to display when this is opened in a browser window."

I believe that you would also like the title to appear above the tabs (which I agree is a good idea). For that, you should add a couple of lines after with self, similar to which appear in the class Interface:

if title:
    Markdown(
        "<h1 style='text-align: center; margin-bottom: 1rem'>"
        + title
        + "</h1>"
    )

@abidlabs abidlabs marked this pull request as draft December 26, 2022 21:44
@abidlabs
Copy link
Copy Markdown
Member

Make sure to add the change to the CHANGELOG.md file so we can credit you too!

@abidlabs abidlabs marked this pull request as ready for review December 26, 2022 23:03
@abidlabs
Copy link
Copy Markdown
Member

LGTM thanks for the contribution to the library @MohamedAliRashad!

image

@abidlabs abidlabs merged commit 21820f4 into gradio-app:main Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

title argument for TabbedInterface

2 participants