Skip to content

How to remove the icon from the header? #4909

Answered by TomJGooding
kostrykin asked this question in Q&A
Discussion options

You must be logged in to vote

The Header doesn't provide an option to remove the icon, but you could do something like this:

from textual.app import App, ComposeResult
from textual.widgets import Header


class ExampleApp(App):
    def compose(self) -> ComposeResult:
        yield Header()

    def on_mount(self) -> None:
        self.query_one("HeaderIcon").visible = False


if __name__ == "__main__":
    app = ExampleApp()
    app.run()

Or hide it using CSS like this:

    HeaderIcon {
        visibility: hidden;
    }

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@TomJGooding
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by kostrykin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants