Skip to content

Implementing Password Show/Hide functionality #1976

Answered by marek-mihok
n-srinidhi asked this question in Q&A
Discussion options

You must be logged in to vote

@n-srinidhi, there is no built-in functionality right now, but you can use an icon button next to the textfield to toggle the password visibility.

from h2o_wave import main, app, Q, ui

password_hidden = True


@app('/demo')
async def serve(q: Q):
    global password_hidden
    if not q.client.initialized:
        q.page['meta'] = ui.meta_card(
            box='',
            layouts=[
                ui.layout(
                    breakpoint='xs',
                    zones=[ui.zone(name='main', size='1')])]
        )
        q.page['login_form'] = ui.form_card(
            box='main',
            items=[
                ui.inline(
                    direction='column',
                    

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@n-srinidhi
Comment options

Answer selected by n-srinidhi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants