New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rfid-reader-input

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rfid-reader-input

Connect your RFID reader and already have a component to capture the value.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-45.45%
Maintainers
1
Weekly downloads
 
Created
Source

< RFIDReaderInput / >

RFID-logo

Capture your RFID reading from your React application in a practical and easy way!



NPM Paackage CodeFactor GitHub

ReactJS ReactJS ViteJS Check NextJS Check



1. Installation

    npm install rfid-reader-input
    # or
    yarn add rfid-reader-input

2. Using Component

    import { RFIDReaderInput } from 'rfid-reader-input'

    ...

    <RFIDReaderInput
      open={isOpenRFIDReaderInput}
      onRequestClose={_handleCloseRFIDReaderInput}
      handleCodeCardRFID={setCodecard}
     />

3. Connect RFID card reader

skills

4. Swipe the card on the reader

d20ac76d-b212-4730-955a-d6fa16efd887 (1) (1)





skills About Library

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.

Advantages

  • Component already made. Install, import and use.
  • Void capturing digits from the keyboard.
  • Intuitive and customizable layout
RFIDReaderInput
image



skills Library

Import

    import { RFIDReaderInput } from 'rfid-reader-input'

Component

     <RFIDReaderInput
      open={isOpenRFIDReaderInput}
      onRequestClose={handleClose}
      handleCodeCardRFID={setCodecard}
      textTitle='RFID Identification'
      textBody='Hold your card'
     />
Props

[!IMPORTANT] For the component to work, insert the properties correctly. You can follow the code example.

  • (mandatory) open < boolean > : here a variable with the value of false or true is inserted to open the Input.
  • (mandatory) onRequestClose < ( ) => void > : receives a function to change the variable to the true state, closing the Input.
  • (mandatory) 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.
  • (optional) textTitle: < string > : text to change the card title.
  • (optional) textBody: < string > : text to change the card body.


Code Example

[!NOTE] Structured code in ViteJS skills

Javascript Javascript

Code

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 ⭐ ⬆️.

by: @digoarthur

buy rfid reader device: rfid reader device

Keywords

FAQs

Package last updated on 06 Apr 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc