Getting startedComponentsDesign tokensThemingTheme synthesizerFrameworksAccessibilityUtilitiesServer renderingBrowser supportContributingChangelogApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip
ARC UIARC Radiant Components
v4.9DocsComponentsTokensSynthesizer
Getting startedFrameworksServer renderingDesign tokensThemingTheme synthesizerTypographyUtilitiesAll componentsAccessibilityBrowser supportChangelogContributingStatsApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip

Password Input

A password field with a show/hide button and an optional strength meter, styled and form-wired like Input.

ComponentsPassword Input
inputinteractivebeta
<arc-password-input>

Overview

PasswordInput wraps a native `<input type="password">` with the same label, placeholder, validation and sizes as Input. An eye button switches the field between masked and plain text, and `show-strength` adds a strength meter. A revealed password stays revealed until the button is pressed again. Blur doesn't re-mask it. The button is a real `<button>` with `aria-pressed` and an accessible name. The meter is a four-segment bar under the field with a label from "Weak" to "Strong". The score rewards length and a mix of character classes, and penalizes repeated characters, runs like "abcd" or "1234", and a built-in list of 20 common passwords. It runs in the browser with no network calls. The meter has `role="meter"` and announces changes politely. PasswordInput joins native forms through ElementInternals, like Input: it submits its value under `name`, supports `required`, and resets with `form.reset()`. Use `autocomplete="new-password"` on sign-up and change-password forms so password managers offer to generate one.

Guidelines

Do

  • Give it a `label`. Placeholder text alone isn't one
  • Turn on `show-strength` where people create a password, and leave it off on login forms
  • Listen to `arc-strength-change` if you block submission below a minimum score
  • Pair it with Form for coordinated validation and an error summary
  • Use the `error` prop for server or policy failures, for example "Password was found in a breach"

Don't

  • Don't treat the score as a security check. Enforce your real policy on the server
  • Don't re-mask the field while someone is typing. The toggle state is theirs
  • Don't block paste. People paste from password managers

Features

  • `arc-strength-change` fires with the 0-4 score, for your own policy UI
  • `autocomplete` passes through to the native field and defaults to `current-password`
  • Labels, sizes, error state and focus rings match Input

Preview

Usage

This component needs JavaScript. Use the Web Component or a framework wrapper.

<!-- Login: masked field with visibility toggle -->
<arc-password-input label="Password" name="password" required></arc-password-input>

<!-- Sign-up: strength meter + password-manager generation -->
<arc-password-input
  label="New password"
  name="new-password"
  autocomplete="new-password"
  show-strength
  required
></arc-password-input>

<script>
  document.querySelector('[show-strength]').addEventListener('arc-strength-change', (e) => {
    console.log('strength score:', e.detail.score); // 0-4
  });
</script>

API

autoValidatesbooleanfalse
Runs its own constraint logic and owns the whole validity flag set.
namestring''
The name attribute sent with form data on submission. Also used by the Form component to track field state.
labelstring''
Visible label rendered above the field. Automatically associated with the input via a generated id.
placeholderstring''
Hint text displayed when the field is empty. Use it for guidance, never as a substitute for the label.
valuestring''
The current value of the field. Can be set programmatically; updated internally on each keystroke.
disabledbooleanfalse
Prevents interaction (including the visibility toggle) and applies a muted visual treatment.
errorstring''
Error message displayed below the field. When set, the border turns red and the message is announced.
autocompletestring'current-password'
Passed through to the inner input. Use new-password on registration or change-password forms so password managers offer generation.
requiredbooleanfalse
Marks the field as required and enables native constraint validation on form submission.
size'sm' | 'md' | 'lg''md'
Controls the field size. Options: 'sm', 'md', 'lg'.
showStrengthbooleanfalse
Renders a four-segment strength meter with a Weak / Fair / Good / Strong label under the field, scored by a built-in heuristic (length, character variety, common-pattern penalties).
formAssociatedbooleantrue
propertiesobject{ // flag(), unlike `disabled`. The exclusion in props.js is specifically // about form-associated *platform* semantics: a `disabled` content // attribute that is merely present makes the element actually disabled // per the HTML spec, and formDisabledCallback assigns the property back, // so no converter can win. Neither of these is platform-mapped: // `required` is enforced by _computeValidity() below and `readonly` by // each component's own interaction handlers, so the stock converter buys // nothing here and costs the usual bug: `required="false"` read as true, // blocking submission of a form the author meant to leave optional. // Finding #48's shape, across all 26 form controls at once. required: flag(false), readonly: flag(false), }
Lit merges static properties up the prototype chain, so every consumer gets these without declaring them. required participates in constraint validation below; readonly reflects for styling and is enforced by each component's interaction handlers (the mixin can't know which gestures mutate state).
form
validity
validationMessage
readonlybooleanfalse

Methods

checkValidity()boolean
Whether the control currently satisfies its constraints, per the native constraint-validation API. Fires invalid on the element when it does not, and reports nothing to the user.
reportValidity()boolean
As checkValidity(), but also shows the browser's validation message against the control when it fails.

Events

arc-strength-change
Fired when the strength score changes (only while show-strength is set), with { score } detail (0-4)
arc-inputdetail:{ value: string }
Fired on each keystroke with { value } detail
arc-changedetail:{ value: string }
Fired on blur when value has changed, with { value } detail

See also