Skip to content
v0.2.10

PasswordInput

A password field with one named visibility action.

Preview

Use PasswordInput

PasswordInput is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
password-input.tsxTSX
"use client";

import { FloodRoot, Field, PasswordInput } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Field label="Password">
        {control => <PasswordInput {...control} name="password-input" />}
      </Field>
    </FloodRoot>
  );
}

Design notes

  • Use visible/onVisibleChange for controlled visibility or defaultVisible for an initial reveal. Translate showPasswordLabel/hidePasswordLabel. Read-only still permits inspection; disabled blocks actions. Native value/onChange, autocomplete, form and ref are preserved. Visibility does not change the value.
  • Composes Flood InputGroup, IconSlot and IconButton using existing semantic geometry and feedback states. Available in 0.2.5.

API reference

PropValuesDefault
status"error" | "warning" | "success" | "info"—
invalidboolean—
controlSize"sm" | "md" | "lg" | "xl""md"
visibleboolean—
defaultVisiblebooleanfalse
onVisibleChange(visible: boolean) => void—
showPasswordLabelstring"Show password"
hidePasswordLabelstring"Hide password"
Native HTML propsOmit<InputHTMLAttributes<HTMLInputElement>, "type" | "children">Forwarded
View TypeScript source