KioskBoard - Virtual Keyboard [Extended Edition]
A pure JavaScript library for using virtual keyboards.
Current Version
2.3.0 *
Documentation and Demo
https://furcan.github.io/KioskBoard/
Browser Compatibility
Chrome
|| Firefox
|| Safari
|| Opera
|| Edge
|| IE 11
(A) Install & Import
Install
yarn add kioskboard
npm i kioskboard
Import
import KioskBoard from "kioskboard";
(B) Adding to an HTML Document
CSS and JS
<link rel="stylesheet" href="dist/kioskboard-2.3.0.min.css" />
<script src="dist/kioskboard-2.3.0.min.js"></script>
Or only JS (All in One - Internal CSS)
<script src="dist/kioskboard-aio-2.3.0.min.js"></script>
Keyboard Types and Themes
3 types of keyboards can be used: all
, keyboard
, and numpad
.
5 types of themes can be used. light
, dark
, flat
, material
, and oldschool
.
Run / Initialize
KioskBoard Virtual Keyboard can be used with the input
or textarea
elements.
KioskBoard must be initialized with the required options. The other ones are optional. Keyboard Type (the default value is "all") data-kioskboard-type
, Keyboard Placement (the default value is "bottom") data-kioskboard-placement
, and Special Characters data-kioskboard-specialcharacters
settings are each element-based (data attributes).
All options and examples of data attribute usages are as below. Also, a custom class name can be defined as globally for all input and/or textarea elements to run KioskBoard.
HTML => (data-* options)
<textarea
class="js-virtual-keyboard"
data-kioskboard-type="all"
data-kioskboard-placement="top"
data-kioskboard-specialcharacters="true"
placeholder="Your Address"
></textarea>
<input
class="js-virtual-keyboard"
data-kioskboard-type="keyboard"
data-kioskboard-placement="bottom"
data-kioskboard-specialcharacters="false"
placeholder="Your Name"
/>
<input
class="js-virtual-keyboard"
data-kioskboard-type="numpad"
data-kioskboard-placement="bottom"
placeholder="Your Number"
/>
JS => (Run with Init)
KioskBoard.run(".js-virtual-keyboard", {
});
OR
JS => (Step1: Initialize)
KioskBoard.init({
keysArrayOfObjects: null,
keysJsonUrl: null,
keysSpecialCharsArrayOfStrings: null,
keysNumpadArrayOfNumbers: null,
language: "en",
theme: "light",
autoScroll: true,
capsLockActive: true,
allowRealKeyboard: false,
allowMobileKeyboard: false,
cssAnimations: true,
cssAnimationsDuration: 360,
cssAnimationsStyle: "slide",
keysAllowSpacebar: true,
keysSpacebarText: "Space",
keysFontFamily: "sans-serif",
keysFontSize: "22px",
keysFontWeight: "normal",
keysIconSize: "25px",
keysEnterText: "Enter",
keysEnterCallback: undefined,
keysEnterCanClose: true,
});
JS => (Step2: Run)
KioskBoard.run(".js-virtual-keyboard");
Language (JSON)
The keysJsonUrl
option has to be set if custom keys are not defined with the keysArrayOfObjects
option. JSON format has to be: [{"key":"value", "key":"value"}, ...]
. Each object in that array creates a row element (HTML) on the keyboard. The "key" in the objects is used as an "index" for each Keyboard Keys. The "value" is each key's value and inner text.
Additionally, KioskBoard includes 9 different language packages: Arabic
, English
, French
, German
, Hungarian
, Persian
, Russian
, Spanish
, and Turkish
.
An example of a JSON file (for custom keys) in English.
[
{
"0": "Q",
"1": "W",
"2": "E",
"3": "R",
"4": "T",
"5": "Y",
"6": "U",
"7": "I",
"8": "O",
"9": "P"
},
{
"0": "A",
"1": "S",
"2": "D",
"3": "F",
"4": "G",
"5": "H",
"6": "J",
"7": "K",
"8": "L"
},
{
"0": "Z",
"1": "X",
"2": "C",
"3": "V",
"4": "B",
"5": "N",
"6": "M"
}
]
Copyright
Copyright © 2022 KioskBoard - Virtual Keyboard
License
MIT license - https://opensource.org/licenses/MIT