Skip to content

How to add an icon to a TextInput? #1059

Answered by yusdacra
push-and-pop asked this question in Q&A
Discussion options

You must be logged in to vote

You can use the icons from iced_aw, and use the Row widget to put an icon before your text input.

Example (might not compile):

let icon = Text::new(Icon::Lock);
let text_input = /* create text input */;
let row = Row::with_children(vec![icon.into(), text_input.into()]);

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@0x57e11a
Comment options

@yusdacra
Comment options

@Kaiden42
Comment options

@0x57e11a
Comment options

Answer selected by hecrj
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
Converted from issue

This discussion was converted from issue #1055 on September 27, 2021 07:07.