[GH-ISSUE #75] Support for InputFields hints/placeholders #55

Closed
opened 2026-03-04 01:01:31 +03:00 by kerem · 5 comments
Owner

Originally created by @muesli on GitHub (Mar 13, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/75

It would be nice if InputFields supported hints (also known as placeholders sometimes).

Originally created by @muesli on GitHub (Mar 13, 2018). Original GitHub issue: https://github.com/rivo/tview/issues/75 It would be nice if InputFields supported hints (also known as placeholders sometimes).
kerem closed this issue 2026-03-04 01:01:31 +03:00
Author
Owner

@rivo commented on GitHub (Mar 13, 2018):

Similarly to my question in #77, is this an actual requirement you came across in your application? All input fields have labels. Maybe you can provide an example where they aren't enough?

<!-- gh-comment-id:372734214 --> @rivo commented on GitHub (Mar 13, 2018): Similarly to my question in #77, is this an actual requirement you came across in your application? All input fields have labels. Maybe you can provide an example where they aren't enough?
Author
Owner

@muesli commented on GitHub (Mar 13, 2018):

It would be nice to give user some form of indication what a reasonable / expected value would look like, without having to pre-set it as an InputField's value. One could add this information to the label, but in case of longer hints, this quickly breaks the layout and looks a bit messy from a UX perspective.

<!-- gh-comment-id:372737054 --> @muesli commented on GitHub (Mar 13, 2018): It would be nice to give user some form of indication what a reasonable / expected value would look like, without having to pre-set it as an InputField's value. One could add this information to the label, but in case of longer hints, this quickly breaks the layout and looks a bit messy from a UX perspective.
Author
Owner

@rivo commented on GitHub (Mar 15, 2018):

Have a look at the latest commit. This adds SetPlaceholder() to InputField.

<!-- gh-comment-id:373433981 --> @rivo commented on GitHub (Mar 15, 2018): Have a look at the latest commit. This adds `SetPlaceholder()` to `InputField`.
Author
Owner

@muesli commented on GitHub (Mar 18, 2018):

Works nicely, the only minor nitpick I have is that it's barely readable with the default color scheme.

<!-- gh-comment-id:373969704 --> @muesli commented on GitHub (Mar 18, 2018): Works nicely, the only minor nitpick I have is that it's barely readable with the default color scheme.
Author
Owner

@rivo commented on GitHub (Mar 18, 2018):

It looks good in my terminal. The idea is to give it low contrast (just like HTML placeholders are usually also low-contrast) so it's not confused with actual input. But you're free to set Styles.ContrastSecondaryTextColor to your own choice of color.

<!-- gh-comment-id:374039004 --> @rivo commented on GitHub (Mar 18, 2018): It looks good in my terminal. The idea is to give it low contrast (just like HTML placeholders are usually also low-contrast) so it's not confused with actual input. But you're free to set `Styles.ContrastSecondaryTextColor` to your own choice of color.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#55
No description provided.