![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
rfid-reader-input
Advanced tools
Connect your RFID reader and already have a component to capture the value.
Capture your RFID reading from your React application in a practical and easy way!
npm install rfid-reader-input
# or
yarn add rfid-reader-input
import { RFIDReaderInput } from 'rfid-reader-input'
...
<RFIDReaderInput
open={isOpenRFIDReaderInput}
onRequestClose={_handleCloseRFIDReaderInput}
handleCodeCardRFID={setCodecard}
/>
This library has a React component, , to facilitate data entry while reading from your RFID device. Use in your Dashboard systems to control presence, record processes linked to people, etc.
RFIDReaderInput |
---|
import { RFIDReaderInput } from 'rfid-reader-input'
<RFIDReaderInput
open={isOpenRFIDReaderInput}
onRequestClose={handleClose}
handleCodeCardRFID={setCodecard}
textTitle='RFID Identification'
textBody='Hold your card'
/>
[!IMPORTANT] For the component to work, insert the properties correctly. You can follow the code example.
open
< boolean > : here a variable with the value of false or true is inserted to open the Input.onRequestClose
< ( ) => void > : receives a function to change the variable to the true state, closing the Input.handleCodeCardRFID
< (code: string) => void > : Here a function is inserted that will receive the value captured from the reading device. It can be a state function coming from the parent component, or from a contextAPI.textTitle
: < string > : text to change the card title.textBody
: < string > : text to change the card body.[!NOTE] Structured code in ViteJS
import { useState } from 'react'
import './App.css'
import { RFIDReaderInput } from 'rfid-reader-input';
function App() {
//CSS EFFECT
const [isHover, setIsHover] = useState(false);
const handleMouseEnter = () => {
setIsHover(true);
};
const handleMouseLeave = () => {
setIsHover(false);
};
const boxStyle = {
filter: isHover ? 'drop-shadow(0 0 5em #617874ee)' : ''
};
//RFIDReaderInput State
const [serialCard, setSerialcard] = useState('');
const [openCardReaderWindow, setOpenCardReaderWindow] = useState<boolean>(false)
function handleOpenRFID() {
setOpenCardReaderWindow(true);
}
function handleCloseRFID() {
setOpenCardReaderWindow(false);
}
return (
<>
<div>
<RFIDReaderInput isOpen={openCardReaderWindow} onRequestClose={handleCloseRFID} handleCodeCardRFID={ setSerialcard} />
<a href="https://github.com/DIGOARTHUR/rfid-reader-input" target="_blank">
<img src='https://github.com/DIGOARTHUR/rfid-reader-input/assets/59892368/a6367195-e847-4157-bffb-5932d73bd076'
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
style={boxStyle} alt="React logo"
/>
</a>
</div>
<h1>{serialCard?serialCard:'‹ RFIDReaderInput /›'}</h1>
<div className="card">
<button onClick={handleOpenRFID}>
Open RFIDReaderInput
</button>
<p>
Edit <code>src/App.tsx</code> and save to test
</p>
</div>
<p className="read-the-docs">
Click on the RFIDReaderInput logo to learn more
</p>
</>
)
}
export default App
Love rfid-reader-input? Give our repo a star ⭐ ⬆️.
buy rfid reader device
: rfid reader device
FAQs
Connect your RFID reader and already have a component to capture the value.
The npm package rfid-reader-input receives a total of 5 weekly downloads. As such, rfid-reader-input popularity was classified as not popular.
We found that rfid-reader-input demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
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.