Skip to content

Password Input

InputWeb + NativeMIT
View in Storybook

Password field with show/hide toggle and accessible labeling.

bun add @otfdashkit/ui

Preview

Password Input
Loading Storybook preview…

Code

import React, { useState } from 'react'
import { Field, PasswordInput } from '@otfdashkit/ui'

function PasswordDemo() {
  const [val, setVal] = useState('')
  return (
    <div className="flex flex-col gap-4 max-w-sm">
      <Field label="Password">
        <PasswordInput placeholder="Enter password" value={val} onChange={e => setVal(e.target.value)} />
      </Field>
      <Field label="Password with strength">
        <PasswordInput placeholder="Enter password" strength value={val} onChange={e => setVal(e.target.value)} />
      </Field>
    </div>
  )
}

export function Example() {
  return (
    <PasswordDemo />
  )
}

Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.

Props

Props declared in the PasswordInput source. Inherited HTML attributes are not listed.

PropTypeDefaultDescription
strengthboolean