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 🙏

© 2026 – Pkg Stats / Ryan Hefner

angular-touch-keyboard

v0.0.35

Published

Mobile-friendly virtual keyboard for Angular inputs, textareas, and editable divs.

Readme

Angular Touch Keyboard

A mobile-friendly virtual keyboard for Angular inputs, textareas, and editable divs.

Angular Touch Keyboard Preview

Features

  • Works with input, textarea, and div elements.
  • Automatic layout selection from inputmode (text, email, url, numeric, decimal, tel).
  • Built-in locales: en-US, en-GB, fa-IR, he-IL, ka-GE, po-OS, ru-RU, sv-SE.
  • Full-screen mode for kiosk/tablet experiences.
  • Outside-click handling that avoids duplicate accept/close flows.
  • Optional native keyboard suppression for touch devices.

Install

npm install angular-touch-keyboard

Quick Start

  1. Import the module:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AngularTouchKeyboardModule } from 'angular-touch-keyboard';

import { AppComponent } from './app.component';

@NgModule({
	declarations: [AppComponent],
	imports: [BrowserModule, FormsModule, AngularTouchKeyboardModule],
	bootstrap: [AppComponent],
})
export class AppModule {}
  1. Use the directive on an input:
<input
	type="text"
	inputmode="text"
	angularTouchKeyboard="en-US"
	placeholder="Tap to open keyboard"
/>

Usage Examples

Numeric keypad

<input
	type="text"
	inputmode="numeric"
	angularTouchKeyboard="en-US"
	placeholder="PIN"
/>

Decimal keypad with custom initial layout

<input
	type="text"
	inputmode="decimal"
	angularTouchKeyboard="po-OS"
	ngxLayoutName="minus"
	placeholder="Amount"
/>

Open with a button

<input
	#keyboard="angularTouchKeyboard"
	type="text"
	inputmode="text"
	angularTouchKeyboard="en-US"
	[ngxTouchKeyboardOpenWithButton]="true"
/>

<button type="button" (click)="keyboard.togglePanel()">Open Keyboard</button>

Validate input before accept

<input
	type="text"
	inputmode="numeric"
	angularTouchKeyboard="en-US"
	[validate]="allowOnlyPositiveIntegers"
	(acceptClick)="onAccept($event)"
/>
allowOnlyPositiveIntegers = (value?: string): boolean =>
	!!value && /^\d+$/.test(value);

onAccept(): void {
	// Handle accepted value here
}

Add A Custom Keyboard Layout

You can extend a built-in locale at runtime and point ngxLayoutName to your new layout.

Custom Layout Example

import { Component } from '@angular/core';
import {
	AngularTouchKeyboardLocales,
	AngularTouchKeyboardLocale,
} from 'angular-touch-keyboard';

@Component({
	selector: 'app-demo',
	template: `
		<input
			type="text"
			inputmode="text"
			angularTouchKeyboard="en-US"
			ngxLayoutName="finance"
			placeholder="Finance layout"
		/>
	`,
})
export class DemoComponent {
	constructor() {
		const locale = AngularTouchKeyboardLocales.enUS as AngularTouchKeyboardLocale;

		locale.layouts['text_finance'] = [
			['1', '2', '3', '4', '5'],
			['6', '7', '8', '9', '0'],
			['+', '-', '*', '/', '{backspace}'],
			['(', ')', '.', ',', '{done}'],
		];

		locale.display['{done}'] = 'Apply';
	}
}

Notes:

  • For inputmode="text", the layout key format is text_<layoutName>.
  • For inputmode="numeric", use numeric_<layoutName>.
  • Functional keys are wrapped with braces (example: {backspace}, {done}).

Directive Inputs

| Input | Type | Default | Description | |---|---|---|---| | angularTouchKeyboard | string | '' | Locale code (example: en-US). | | ngxLayoutName | string | 'alphabetic' | Initial layout name (without mode prefix). | | ngxTouchKeyboardDiv | boolean | auto | Enables editable div mode. | | ngxTouchKeyboardOpenWithButton | boolean | false | Prevents auto-open on focus. | | ngxTouchKeyboardDebug | boolean | false | Logs keyboard internals. | | ngxTouchKeyboardFullScreen | boolean | false | Opens keyboard in full-screen mode. | | ngxTouchKeyboardOutsideClick | boolean | true | Controls outside click accept/close behavior. | | ngxTouchKeyboardSuppressSystemKeyboard | boolean | false | Tries to suppress native soft keyboard on touch devices. | | ngxTouchKeyboardPreventSystemKeyboard | boolean | false | Alias of ngxTouchKeyboardSuppressSystemKeyboard. | | validate | (value?: string) => boolean | undefined | Optional validation before accept. |

Events

| Output | Payload | Description | |---|---|---| | acceptClick | AngularTouchKeyboardComponent | Fired when value is accepted. |

Build And Publish

ng build angular-touch-keyboard
cd dist/angular-touch-keyboard
npm publish