Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
    • Checkbox
    • ChoiceGroup
    • CurrencyInput
    • DateInput
    • FileInputZone
    • Filters
    • Form
    • MaskedTextInput
    • PasswordInput
    • Pill
    • Pill
    • Radio
    • SearchInput
    • SegmentedSlider
    • Select
    • Switch
    • TextArea
    • TextInput
  • Layout & containers
  • Overlays
  • Feedback & status
  • Data display
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
  • Forms & inputs
  • PasswordInput

PasswordInput

Captures a password. `strengthCheck` adds a strength hint, which guides the member without blocking them.

Health
Component health
Source
View on Github
Design
View Figma
Storybook
View in Storybook
Playground
No Example
Accessibility

partially-compliant

Platform
Universal
Accessibility issues
the show/hide password button is not accessible with keyboard navigation
  • Overview
  • Props
  • Figma

Usage​

Input help text

Strength check​

This input has a built-in strength check that can be enabled by passing strengthCheck prop. It doesn't enforce validation but provides a visual indicator of the strength of the password:

 

Localization​

This input comes with built-in localization for the strength check and visibility indicator. To change the language, pass locale prop. The default is en.

Controlled​

import { useState } from "react";
import { TextInput } from "murray";

function Demo() {
const [value, setValue] = useState("");
return <TextInput value={value} onChange={(newValue) => setValue(newValue)} />;
}

Error state​

 

Invalid name

 

Disabled state​

 

Condensed theme​

For applications with condensed theme density, this component renders in a condensed style:

Usage in <Form>​

On web, TextInput can be used in <Form> component and be controleld by Formik:

 

Playground​

Loading...
tip
This component is universal, its usage is the same in murray and murray/mobile.

PasswordInput props

NameTypeDefault ValueDescriptionUsage count
aria-describedbystringId of an element outside the input that also describes it, such as an error shared by several inputs
aria-labelstringAccessibility label, only necessary when not associated with a label
aria-requiredbooleanOverrides `aria-required` set by `required`, to mark the input as mandatory without the asterisk
autoFocusbooleanIf true, focuses the input on componentDidMount.The default value is false.
cursorCursorEnforce a cursor type
defaultValuestringUncontrolled default value.
disabledbooleanDisable input
enterKeyHint"search""done""go""next""send"
errorReactNodeContents of `InputError` component, if not set, error is not rendered.
focusedbooleanShow focus styles even when the input isn't focused, e.g. while a readonly input's picker is open
helpTextReactNodeContents of `InputHelp` component, if not set, description is not rendered.
idstring
label*ReactNodeContents of `InputLabel` component, if not set, label is not rendered.
localeLocaleLanguage to use for strengh validation
maxstringnumber
maxLengthnumberMaximum string length that the user can enter in UTF-16 code units
minstringnumber
minLengthnumberMaximum string length that the user can enter in UTF-16 code units
namestringHtml input name
onChange((value: string) => void)Trigger when input value is changing
onPress((event: GestureResponderEvent) => void)
placeholderstring
readonlybooleanMake input readonly
render
1 possibilities((elements: { input: ReactNode; prefix?: ReactNode; suffix?: ReactNode; }, pseudoState: PseudoState) => ReactNode)
Fully control how input, prefix and suffix are rendererd
renderPlaceholder(() => ReactNode)To render a custom placeholder view when the field is empty
requiredbooleanAdds required attribute to the input and a red asterisk on the right side of label, `false` by default Determines whether the input should have `aria-required` attribute
stepstringnumber
strengthCheckbooleanEnables password strength feedback
titlestringHtml input title
valuestringControl the input.

Undocumented props

NameTypeDefault ValueDescriptionUsage count
autoCapitalizeany
autoCompleteany
autoCorrectany
clearButtonModeany
onBlurany
onSubmitEditingany
refany
returnKeyTypeany
testIDany
textContentTypeany
Edit this page
Previous
MaskedTextInput
Next
Pill
  • Usage
  • Strength check
  • Localization
  • Controlled
  • Error state
  • Disabled state
  • Condensed theme
  • Usage in <Form>
  • Playground

Input help text