OneScript

SecureField

Accept a password or other private text.

A controlled single-line input that masks what the user types. Use it for passwords, PINs, and tokens.

import { SecureField, useState } from "onescript/views"

function PasswordField() {
  const [password, setPassword] = useState("")
  return (
    <SecureField
      value={password}
      onChange={setPassword}
      prompt="Password"
    />
  )
}
PropTypeDescription
valuestringCurrent text value.
onChange(value: string) => voidRuns when the user changes the text.
promptstringGuidance displayed while the value is empty.

Also accepts Modifiers. It is only available in App and Action view sessions; widgets reject it with an unsupported view type error.

How is this guide?

Last updated on