React UI Components Documentation
The React PasswordInput enables users to input passwords. This guide adds the React PasswordInput (jqxPasswordInput) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-scriptsjqwidgets-scripts/jqwidgets-react-tsx/jqxpasswordinput 
In a React project (to start one, see Getting started with React), add the package:
npm install jqwidgets-scripts
import JqxPasswordInput from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxpasswordinput';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.tailwind-blue-dark.css';
jqx.base.css is required. The second file is a theme; pick one of the jqx.*.css files (material, fluent, light, dark and more) and pass its name to the theme prop.
The source of the live Default Functionality demo:
import type { JSX } from 'react';
import JqxPasswordInput from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxpasswordinput';
function App(): JSX.Element {
return (
<JqxPasswordInput
theme="tailwind-blue-dark"
width={200}
height={25}
placeHolder="Enter password"
/>
);
}
export default App;
Options are props. Keep objects such as the data adapter and the columns stable across renders with useMemo, so the component does not reload them.
Each event is a prop named on plus the event name with a capital first letter. For example, change: This event is triggered when the value in the input is changed.
const handleChange = (event: any): void => {
console.log(event.args);
};
return <JqxPasswordInput onChange={handleChange} />;
Call methods through a ref. For example, val: Gets or sets the password.
import { useRef } from 'react';
const myPasswordInput = useRef<JqxPasswordInput>(null);
const onClick = () => {
const value = myPasswordInput.current!.val();
console.log(value);
};
return <JqxPasswordInput ref={myPasswordInput} />;
Every component also has setOptions({ … }) and getOptions('name'), to change or read options after the first render.