npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@autosys/react-base-keyboard

v2.0.1

Published

This is an example application featuring a virtual on-screen keyboard, developed using React, TailwindCSS and DaisyUI.

Downloads

4

Readme

On-Screen Keyboard App

This is an example application featuring a virtual on-screen keyboard, developed using React, TailwindCSS and DaisyUI.

TypeScript React TailwindCSS DaisyUI

PNPM Licence

Screenshot

With this application, users can input text using the virtual keyboard, use Caps Lock, Backspace, Space, and Enter keys.

Installation:

NPM

Install with npm:

npm install @autosys/react-base-keyboard

Install with yarn:

yarn add @autosys/react-base-keyboard

Install with pnpm:

pnpm add @autosys/react-base-keyboard

Technologies

  • React: JavaScript library for building user interfaces.
  • TailwindCSS: CSS framework.
  • DaisyUI: component library for Tailwind CSS.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Example Usage:

  1. Wrap your application with the MuiKeyboardProvider:
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { MuiKeyboardProvider } from './context/MuiKeyboardProvider';
import { numbers, englishLetters } from './Keyboards';
import './index.css';

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
  <MuiKeyboardProvider
    letters={englishLetters}
    numbers={numbers}
    reverseButton
    betweenButtons={'10px'}
    functionalButtonStyle={{
      backButtonStyle: {
        className:
          'bg-slate-100 hover:bg-indigo-300 uppercase text-indigo-900 btn-outline border-indigo-800/70 shadow-md justify-end w-[150px] mr-2',
      },
      spaceButtonStyle: {
        className:
          'bg-slate-100 hover:bg-indigo-300 btn-outline border-indigo-800/70 text-indigo-900 text-xl m-2 w-full',
      },
      letterButtonStyle: {
        className: 'text-indigo-900 text-xl btn-ghost',
      },
      reverseButtonStyle: {
        className: 'text-indigo-900 text-xl btn-ghost',
      },
      enterButtonStyle: {
        className: 'text-indigo-900 text-xl btn-ghost',
      },
      capsButtonStyle: { className: 'btn-ghost' },
    }}
    numberButtonStyle={{
      className:
        'bg-slate-100 hover:bg-indigo-300 btn-outline border-indigo-800/70 text-indigo-900 text-xl m-1 w-20',
    }}
    textButtonStyle={{
      className:
        'bg-slate-100 hover:bg-indigo-300 btn-outline border-indigo-800/70 shadow-md text-indigo-900 text-xl m-1 w-16',
    }}
  >
    <App />
  </MuiKeyboardProvider>,
);

reportWebVitals();
  1. Then yo may use the useMuiKeyboard hook in any another component to access the input value and setter from the context.
// App.tsx
import React from 'react';
import { useMuiKeyboard } from './context/MuiKeyboardProvider';

const App = () => {
  const { inputValue, keyBoard, keyboardFeature } = useMuiKeyboard();
  return (
    <div>
      <input
        type="text"
        className="input input-bordered input-primary w-full max-w-xs"
        value={inputValue}
      />
      {keyBoard}
      <button className="btn" onClick={() => keyboardFeature({ openKeyboard: true })}>
        {'open'}
      </button>
    </div>
  );
};

export default App;
  • {keyBoard} is the keyboard itself
  • If you want to reset the inputValue, but don't want to do it with a button on the keyboard, you can use any other button with onClick={() => keyboardFeature({ resetText: true })}
  • To open the keyboard, use onClick={() => keyboardFeature({ openKeyboard: true })}, to close onClick={() => keyboardFeature({ openKeyboard: false })}

Properties

| Name | Type | Description | | ----------------------- | ------------------ | ----------------------------------------------------------------------- | | numbers* | string[] | Array of number and special characters for keyboard buttons. | | letters | string[] | Array of letters characters for keyboard buttons. | | reverseButton* | boolean | Text reset button. | | betweenButtons* | string \| number | Distance between buttons. | | alwaysOpen* | boolean | If you want the keyboard to always be open, set true. Default false | | functionalButtonStyle | object | Object containing styles for functional buttons. | | .backButtonStyle* | object | Styles for the back button including className. | | ..className | string | ClassName for the back button. | | .spaceButtonStyle* | object | Styles for space button including className. | | ..className | string | ClassName for the space button. | | .letterButtonStyle* | object | Styles for letter buttons including className. | | ..className | string | ClassName for the letter buttons. | | .reverseButtonStyle* | object | Styles for reverse button including className. | | ..className | string | ClassName for the reverse button. | | .enterButtonStyle* | object | Styles for enter button including className. | | ..className | string | ClassName for the enter button. | | .capsButtonStyle* | object | Styles for caps button including className. | | ..className | string | ClassName for the caps button. | | numberButtonStyle* | object | Styles for number buttons including className. | | .className | string | ClassName for the number buttons. | | textButtonStyle | object | Styles for text buttons including className. | | .className | string | ClassName for the text buttons. |

Props marked with * are required.