Password Input

A password input component with a visibility toggle button to show or hide the entered password.

Anatomy

<script>
  import { PasswordInput } from "@saas-ui/svelte/components/password-input";
</script>

<PasswordInput placeholder="Enter your password" />

Examples

Basic Accessibility

Basic password input with visibility toggle button.

Colours Accessibility

Password input with different colour schemes using the colour prop.

Controlled Accessibility

Controlled password input with external value management.

Controlled Visibility Accessibility

Controlled visibility state to programmatically show or hide the password.

Disabled Accessibility

Disabled password input that prevents user interaction.

Invalid Accessibility

Use the invalid prop to display validation error styling.

Sizes Accessibility

Password input in different sizes. Available sizes: xs, sm, md, lg.

With Field Accessibility

Password input with Field wrapper for label and helper text support.

Props

Prop Type Default Description
size xs | sm | md | lg md The size of the component.
colour gray | red | orange | yellow | green | teal | blue | cyan | purple | pink | rose gray The colour theme of the component.
invalid boolean false Whether the component is in an invalid state.
disabled boolean false Whether the component is disabled.
placeholder text - Placeholder text for the input.
class text - Additional CSS classes to apply.