![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
jb-input-react
Advanced tools
this component is React.js wrapper for jb-input web component.
text input react component
with these benefits:
easy to add custom regex or function validation.
multiple validation with different message.
support both RTL and LTR.
add label and message in UX friendly format.
customizable ui with css variable so you can have multiple style in different scope of your app.
custom display for password and number input.
support typescript
Demo : Demo: codeSandbox preview for just see the demo and codeSandbox editor if you want to see and play with code
npm i jb-input-react
in your jsx file
import {JBInput} from 'jb-input-react';
<JBInput label="label:" message="hint message under textbox"></JBInput>
//when default property are defined best time for impl your config
<JBInput onInit={(event) => {}}></JBInput>
//when dom bound and rendered in browser dom 3 and you can access all property
<JBInput onLoad={(event) => {}}></JBInput>
//keyboard event
<JBInput onKeyDown={(event) => console.log(event.target.value)}></JBInput>
<JBInput onKeyUp={(event) => console.log(event.target.value)}></JBInput>
<JBInput onKeyPress={(event) => console.log(event.target.value)}></JBInput>
<JBInput onChange={(event) => console.log(event.target.value)}></JBInput>
// when user press enter on type good for situation you want so submit form or call search function on user press enter.
<JBInput onEnter={(event) => console.log(event.target.value)}></JBInput>
//focus event
<JBInput onFocus={(event) => console.log(event.target.value)}></JBInput>
<JBInput onBlur={(event) => console.log(event.target.value)}></JBInput>
//input Event
<JBInput onInput={(event) => console.log(event.target.value)}></JBInput>
<JBInput onBeforeInput={(event) => console.log(event.target.value)}></JBInput>
you can set validation to your input by creating a validationList array and passing in to validationList props:
const validationList = [
{
validator: /.{3}/g,
message: 'عنوان حداقل باید سه کارکتر طول داشته باشد'
},
#you can use function as a validator too
{
validator: ({displayValue,value})=>{return value == "سلام"},
message: 'شما تنها میتوانید عبارت سلام را وارد کنید'
},
]
<JBInput validationList={validationList}></JBInput>
you can check if an input value meet your validation standad by creating a ref of the element using React.createRef()
.
const elementRef = React.createRef();
const isValid = elementRef.current.validation.checkValidity(true).isAllValid;
if isValid
is true
the value of input is valid.
props name | description |
---|---|
disabled | disable the input |
inputmode | set input mode help mobile device to open proper keyboard for your input like url, search and numeric |
direction | set web-component direction default set is rtl but if you need ltr use |
since jb-input-react use jb-input underneath, read jb-input custom style section.
in JBInput you can put icon or any other custom html DOM in input box. to doing so you just have to place custom DOM in JBInput tag and add slot="start-section"
or slot="end-section"
to place it before or after input field.
<JBInput>
<div slot="end-section">after</div>
<div slot="start-section">before</div>
</JBInput>
see jb-input if you want to use this component as a pure-js web-component
see All JB Design system Component List for more components
use Contribution Guide if you want to contribute in this component.
FAQs
input react component
The npm package jb-input-react receives a total of 5 weekly downloads. As such, jb-input-react popularity was classified as not popular.
We found that jb-input-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.