The FullKeyboard component is a full-featured virtual keyboard that supports letter, number, and symbol input. It uses a QWERTY layout and is suitable for scenarios requiring complete text input.
Set the keyboard style via type:
button (default): Button style with shadow, border radius, and spacingblock: Block style without shadow, no radius, compact layoutSet the keyboard mode via mode:
letter: Letters onlyletterNumber: Letters + Numbersfull (default): Letters + Numbers + Symbols, switchableThe FullKeyboard component contains the following types of keys:
letterNumber and full modesfull modefull modeWhen doneDisabled is set to true, the done button will be disabled. In this case, the done button text will become semi-transparent and cannot be clicked. This can be used to dynamically control the business flow based on input content, such as validating whether the input length meets requirements.
When using the keyboard on mobile devices, it is important to consider the height of the keyboard as it may cover areas on the page where input content needs to be displayed. The FullKeyboard component automatically calculates the keyboard height when it opens and dispatches it through the onopen event. Developers can use this value to handle the keyboard covering issue.
The keyboard height dynamically changes based on mode and preview parameters:
letter mode has a lower base heightletterNumber and full modes have increased height due to the additional number rowpreview adds the preview area heightCSS class names (not limited to Tailwind CSS) can be injected into three parts of FullKeyboard through injClass related parameters, allowing for more customization possibilities:
panelClass: Injected to affect the keyboard panelkeyClass: Injected to affect all keysdoneClass: Injected to affect the done keyIf the injected class does not take effect, please prepend "!" to the class name being injected. You can refer to Tailwind Important modifier for more information.
When preview is set to true, an input preview area will be displayed at the top of the keyboard, showing the current input content in real-time. This is very useful for scenarios where you need to confirm the input content. previewMask can display the preview content as dot masks, suitable for password input scenarios.
FullKeyboard is built on top of the Popup component with predefined Popup Props. Different effects can be achieved by passing in Popup properties. For example, you can change the transition animation and background transparency by setting popup.
If you don't need to use a popup, you can set popup to null, and the FullKeyboard will be displayed directly on the page without appearing as a popup.