KeyboardKit helps you build custom keyboard extensions for iOS and iPadOS, using Swift and SwiftUI. It extends the native keyboard APIs and provides you with a lot more functionality than is otherwise available.
KeyboardKit lets you create keyboards that mimic the native iOS keyboards in a few lines of code. These keyboards can be customized to great extent to change input keys, keyboard layout, design, behavior etc.
You can also use entirely custom views together with the rich features of KeyboardKit, to create completely custom keyboards. Most of the library can be used on all major Apple platforms.
Installation
KeyboardKit can be installed with the Swift Package Manager:
https://github.com/KeyboardKit/KeyboardKit.git
or with CocoaPods:
pod KeyboardKit
You can add the library to the main app, the keyboard extension and any other targets that need it. If you prefer to not have external dependencies, you can also just copy the source code into your app.
⌨️ Keyboard - KeyboardKit supports different keyboard types, provides observable keyboard state, etc.
🔣 Layout - KeyboardKit supports creating keyboard layouts for various devices, locales etc.
🌐 Localization- KeyboardKit defines keyboard-specific locales with localized content and assets.
👁 Previews - KeyboardKit has utilites that help previewing keyboard views and components in SwiftUI.
➡️ Proxy - KeyboardKit extends UITextDocumentProxy and makes it do a lot more.
🚏 Routing - KeyboardKit lets you route text to other destinations than the main app.
⬅️ RTL - KeyboardKit supports RTL (right-to-left) locales, such as Arabic, Persian, Kurdish Sorani etc.
⚙️ Settings - KeyboardKit has tools for accessing and linking to an app’s keyboard settings.
Getting Started
The online documentation has a getting-started guide that will help you get started with the library.
To make your custom keyboard extension use KeyboardKit, just install and import KeyboardKit, then make it inherit KeyboardInputViewController instead of UIInputController:
import KeyboardKit
class KeyboardController: KeyboardInputViewController {}
This will by default set up a fully working U.S. English keyboard. You can then override any functions to customize how it sets up the keyboard, inject your own services, for instance:
The online documentation has articles, code examples etc. that let you overview the various parts of the library and understand how they all connect to each other.
The online documentation is currently iOS-specific. To generate documentation for the other platforms, open the package in Xcode, select a simulator then run Product/Build Documentation.
KeyboardKit Pro
KeyboardKit Pro extends KeyboardKit with pro features, such as localized keyboards and services, autocomplete, dictation, emoji skintones, additional views etc. It lets you create fully localized keyboards with a single line of code.
Demo Application
This project has a Demo folder with a demo app that lets you try out KeyboardKit and KeyboardKit Pro. The app has an input text field and shows you how to display the state of a keyboard extension, link to system settings etc.
The demo app has 5 keyboard extensions:
English uses KeyboardKit and has a SystemKeyboard with the standard, English locale.
Unicode uses KeyboardKit and has a SystemKeyboard with unicode-based input keys.
Custom uses KeyboardKit and has a SystemKeyboard with custom keys, layout and appearance.
Pro uses KeyboardKit Pro and has a SystemKeyboard with all LRT locales, autocomplete etc.
ProRtl uses KeyboardKit Pro and has a SystemKeyboard with all RTL locales, autocomplete etc.
Just open and run the demo app, then enable the keyboards you want to try under System Settings. Note that you need to enable full access to try some features, like audio and haptic feedback.
Support
KeyboardKit is trusted and proudly sponsored by the following companies:
KeyboardKit is open-source and completely free, but you can sponsor this project on GitHub Sponsors, upgrade to KeyboardKit Pro or get in touch for freelance work, paid support etc.
Contact
Feel free to reach out if you have questions or if you want to contribute in any way:
About KeyboardKit
KeyboardKit helps you build custom keyboard extensions for iOS and iPadOS, using Swift and SwiftUI. It extends the native keyboard APIs and provides you with a lot more functionality than is otherwise available.
KeyboardKit lets you create keyboards that mimic the native iOS keyboards in a few lines of code. These keyboards can be customized to great extent to change input keys, keyboard layout, design, behavior etc.
You can also use entirely custom views together with the rich features of KeyboardKit, to create completely custom keyboards. Most of the library can be used on all major Apple platforms.
Installation
KeyboardKit can be installed with the Swift Package Manager:
or with CocoaPods:
You can add the library to the main app, the keyboard extension and any other targets that need it. If you prefer to not have external dependencies, you can also just copy the source code into your app.
Supported Platforms
KeyboardKit supports
iOS 14
,macOS 11
,tvOS 14
andwatchOS 7
.Supported Locales
KeyboardKit is localized in 61 keyboard-specific locales (read more):
🇦🇱 🇦🇪 🇦🇲 🇧🇾 🇧🇬 🇦🇩 🏳️ 🇭🇷 🇨🇿 🇩🇰
🇳🇱 🇧🇪 🇺🇸 🇬🇧 🇺🇸 🇪🇪 🇫🇴 🇵🇭 🇫🇮 🇫🇷
🇧🇪 🇨🇭 🇬🇪 🇩🇪 🇦🇹 🇨🇭 🇬🇷 🇺🇸 🇮🇱 🇭🇺
🇮🇸 🇮🇩 🇮🇪 🇮🇹 🇰🇿 🇹🇯 🇹🇯 🇹🇯 🇱🇻 🇱🇹
🇲🇰 🇲🇾 🇲🇹 🇲🇳 🇳🇴 🇮🇷 🇵🇱 🇵🇹 🇧🇷 🇷🇴
🇷🇺 🇷🇸 🇷🇸 🇸🇰 🇸🇮 🇪🇸 🇰🇪 🇸🇪 🇹🇷 🇺🇦
🇺🇿
Features
KeyboardKit comes packed features to help you build amazing and powerful keyboards:
alphabetic
,numeric
,symbolic
and completely custom input sets.UITextDocumentProxy
and makes it do a lot more.Getting Started
The online documentation has a getting-started guide that will help you get started with the library.
To make your custom keyboard extension use KeyboardKit, just install and import KeyboardKit, then make it inherit
KeyboardInputViewController
instead ofUIInputController
:This will by default set up a fully working U.S. English keyboard. You can then override any functions to customize how it sets up the keyboard, inject your own services, for instance:
For more information, please see the online documentation and getting-started guide.
Documentation
The online documentation has articles, code examples etc. that let you overview the various parts of the library and understand how they all connect to each other.
The online documentation is currently iOS-specific. To generate documentation for the other platforms, open the package in Xcode, select a simulator then run
Product/Build Documentation
.KeyboardKit Pro
KeyboardKit Pro extends KeyboardKit with pro features, such as localized keyboards and services, autocomplete, dictation, emoji skintones, additional views etc. It lets you create fully localized keyboards with a single line of code.
Demo Application
This project has a
Demo
folder with a demo app that lets you try out KeyboardKit and KeyboardKit Pro. The app has an input text field and shows you how to display the state of a keyboard extension, link to system settings etc.The demo app has 5 keyboard extensions:
English
uses KeyboardKit and has aSystemKeyboard
with the standard, English locale.Unicode
uses KeyboardKit and has aSystemKeyboard
with unicode-based input keys.Custom
uses KeyboardKit and has aSystemKeyboard
with custom keys, layout and appearance.Pro
uses KeyboardKit Pro and has aSystemKeyboard
with all LRT locales, autocomplete etc.ProRtl
uses KeyboardKit Pro and has aSystemKeyboard
with all RTL locales, autocomplete etc.Just open and run the demo app, then enable the keyboards you want to try under System Settings. Note that you need to enable full access to try some features, like audio and haptic feedback.
Support
KeyboardKit is trusted and proudly sponsored by the following companies:
KeyboardKit is open-source and completely free, but you can sponsor this project on GitHub Sponsors, upgrade to KeyboardKit Pro or get in touch for freelance work, paid support etc.
Contact
Feel free to reach out if you have questions or if you want to contribute in any way:
License
KeyboardKit is available under the MIT license. See the LICENSE file for more info.