FieldPassword
A helper that renders Field preconfigured for
password entry: it sets secureTextEntry, adds a lock icon before the input,
and renders a Show/Hide toggle after it.
React Native
import { FieldPassword } from '@hoverinc/design-system-react-native';
<FieldPassword label="Password" onChangeText={setPassword} value={password} />;The Show/Hide toggle is built in — pressing it flips secureTextEntry off and
switches the keyboard to visible-password (iOS) so autocorrect doesn't
interfere with a visible password. There's no prop for this; it's internal
state.
Common Mistakes
iconBefore,elementAfter,addonBefore,addonAfter, andelementBeforearen't accepted onFieldPassword— TypeScript will reject them. The lock icon ownsiconBeforeand the Show/Hide toggle ownselementAfterinternally; there's no way to override either. Use a plainFieldwithsecureTextEntryset manually if you need a custom icon or trailing element on a password input.- Don't wrap
FieldPasswordexpecting to control the visibility toggle from outside — visibility state is internal and not exposed as a prop. - Prefer uncontrolled usage (
defaultValue) over passingvalueunless you have a specific reason to control it — this is the team's default forFieldPasswordandFieldSearchalike, both added specifically to replace inconsistent bespoke password/search inputs built on plainField.