✨ Announcing our seed funding led by Lux Capital! Read more about it on our blog
DocsBlogChangelog

Search documentation...

/

Star

12k+

[ Learn ]

[ Concepts ]

[ Reference ]

PinInput


The PinInput component is similar to the Input component, but it is optimized for entering sequences of digits.

class PinInputState(rx.State):
    pin: str


def index():
    return rx.vstack(
        rx.heading(PinInputState.pin),
        rx.box(
            rx.pin_input(
                length=4,
                on_change=PinInputState.set_pin,
                mask=True,
            ),
        ),
    )
The PinInput component can also be customized as seen below.
class PinInputState(rx.State):
    pin: str


def index():
    return rx.center(
        rx.pin_input(
            rx.pin_input_field(color="red"),
            rx.pin_input_field(border_color="green"),
            rx.pin_input_field(shadow="md"),
            rx.pin_input_field(color="blue"),
            rx.pin_input_field(border_radius="md"),
            on_change=PinInputState.set_pin,
        )
    )

PinInput


The component that provides context to all the pin-input fields.


← NumberInputRadioGroup →

Copyright © 2023 Pynecone, Inc.