FastUI icon indicating copy to clipboard operation
FastUI copied to clipboard

Feature Request: Use a logo image as the navbar `title` (as an alternative to text)

Open jimkring opened this issue 9 months ago • 5 comments

Use Case

When designing a site, I often want to use a logo image as the navbar title (instead of text).

Current Limitations

Right now, the Navbar component only supports a title: str argument.

This results in a nice text title on the navbar, but in my case I would like to use an image. I can't find a way to do that.

image

Current Work-around (not ideal)

I can kind of achieve this by not passing in a title to Navbar() and then setting the first element of the start_links list to be a Link with an Image component inside it. However, the problem with this work-around is that the image gets hidden inside the hamburger menu when the screen width is small.

image

image

Possible Solution

I propose adding support for specifying an image to use instead of text.

Maybe the Navbar constructor could take an title_image: Image argument -- an Image component -- which is used instead of the title, if title_image is not None.

I'm sure there are other good ways to achieve this. Maybe there's already a solution/work-around, that I don't know about.

Thanks for your feedback and consideration of this use case/.

jimkring avatar May 19 '24 16:05 jimkring