CustomKeyboard

Voice-enabled keyboard with a custom layout defined by a Key Definition File

import { CustomKeyboard } from "@roku-sdk/components";
CustomKeyboard(props: IKeyboardPropsWithVoice): JSX.Element

Description

Voice-enabled keyboard with a custom layout defined by a Key Definition File.

CustomKeyboard extends the native DynamicCustomKeyboard node, combining a DynamicKeyGrid (custom KDF layout) with a VoiceTextEditBox for text and voice entry. Use this for standalone on-screen keyboards outside of StandardDialog.

Parameters

NameTypeDescription
propsIKeyboardPropsWithVoice

Example

import { CustomAddressKDF } from "@roku-sdk/components/kdfs";

<CustomKeyboard
  keyDefinitionUri={CustomAddressKDF}
  domain={KeyboardDomain.GENERIC}
  text={query()}
  hintText="Type here…"
  maxTextLength={64}
  showUnderscores={false}
  onText={setQuery}
  gainFocus
  id="keyboard"
  translation={[80, 140]}
/>

Types

IKeyboardPropsWithVoice

Full props for CustomKeyboard: DynamicKeyboardBase key-grid fields plus VoiceTextEditBox text-entry fields.

type IKeyboardPropsWithVoice = IDynamicKeyboardBaseProps & Partial<IVoiceTextEditBoxProps>;

IDynamicKeyboardBaseProps

Properties inherited from DynamicKeyboardBase (key grid + text box behavior).

NameTypeDescription
centerUnderscores?booleanCenters underscore placeholders within the text edit box.
disableVoiceUnderscoreControl?booleanDisables voice underscore control in the text edit box.
domain?KeyboardDomainSpeech-recognition domain for voice entry.
hideTextBox?booleanWhen true, hides the internal VoiceTextEditBox.
initText?stringInitial text pre-populated in the edit box on mount.
showUnderscores?booleanShows underscore placeholders in the text edit box.

Extends IDynamicKeyGridNodeProps.

IKeyboardRSGPaletteNodeProps

Color palette for keyboard key grid rendering.

NameTypeDescription
colorsPaletteColors

IDynamicKeyGridNodeProps

Properties for the internal DynamicKeyGrid sub-node on CustomKeyboard.

Not for standalone DynamicKeyGrid — use IDynamicKeyGridProps instead.

NameTypeDescription
disableKey?stringKey label to disable in the current layout.
enableKey?stringKey label to re-enable in the current layout.
focusVisible?booleanWhen true, focus highlight is visible on the key grid.
horizWrap?booleanWhen true, horizontal navigation wraps at row edges.
jumpToKey?number[]Jump focus to a specific key grid position [row, col].
keyDefinitionUri?stringURI of the Key Definition File that defines the keyboard layout. Required for DynamicCustomKeyboard; set to a packaged .keyboard.json file.
mode?stringActive keyboard mode (must match a mode defined in the KDF).
onKeyFocused?EventHandler<string>Fired when keyboard focus moves to a different key.
onKeySelectedValue?EventHandler<IKeyHandlerData>Fired when a key is selected, with key name and press state.
palette?Component<IKeyboardRSGPaletteNodeProps>Color palette node for keyboard theming.
vertWrap?booleanWhen true, vertical navigation wraps at column edges.

Extends IGroupProps.


What’s Next

Did this page help you?