One-time code input
OTP-friendly text input with autocomplete="one-time-code".
Standalone
Section titled “Standalone”from almasix.orbit.forms import Form, OneTimeCodeInput
form = Form.make("demo").schema([ OneTimeCodeInput.make("code") .label("Verification code") .required() .max_length(6)])In a Resource
Section titled “In a Resource”from almasix.orbit import Resourcefrom almasix.orbit.forms import Form, OneTimeCodeInput
class PostResource(Resource): @classmethod def form(cls, form: Form) -> Form: return form.schema([ OneTimeCodeInput.make("otp").required().max_length(6), OneTimeCodeInput.make("backup_code").helper_text("From your recovery list"), ])Key methods
Section titled “Key methods”Inherits TextInput; autocomplete defaults toone-time-code``.max_length(n) / .required().autocomplete(...) to override.disabled(...) / .visible(...)
Closures work on .label(), .helper_text(), .placeholder(), .visible(), .disabled(), and .required() — see Form closures.
Preview
Section titled “Preview”
