Blazorise On-screen Keyboard API

Explore the Blazorise On-screen Keyboard API reference for parameters, events, methods, and related types.

For examples and usage guidance, see the On-screen Keyboard documentation.

API

Parameters

OnScreenKeyboardProvider

ParameterDefaultType
AriaLabel"On-screen keyboard"string

Gets or sets the keyboard aria-label.
ChildContentnullRenderFragment

Gets or sets custom keyboard content.
KeyboardSizeMediumOnScreenKeyboardSize?

Gets or sets the keyboard visual width.
When omitted, uses the global keyboard size. Falls back to FullWidth if global keyboard options are unavailable.
KeyColorColor.SecondaryColor

Gets or sets the button color.
KeyLayoutCenteredOnScreenKeyboardKeyLayout?

Gets or sets the key arrangement inside keyboard rows.
When omitted, uses the global key layout. Falls back to Stretch if global keyboard options are unavailable.
KeyMinHeight56int?

Gets or sets the key minimum height, in pixels.
When omitted, uses the global minimum height, then 56 pixels for centered keys or 40 pixels for stretched keys.
KeyOutlinetruebool

Gets or sets whether key buttons should be outlined.
KeySizeDefaultSize

Gets or sets the button size.
Possible values:DefaultExtraSmallSmallMediumLargeExtraLarge
KeyTabIndex-1int?

Gets or sets the tab index for rendered key buttons.
KeyTemplatenullRenderFragment<OnScreenKeyboardKeyContext>

Gets or sets the template used to render each keyboard key content.
KeyWidth72int?

Gets or sets the base key width, in pixels, used by centered key layout.
When omitted, uses the global key width, falling back to 72 pixels.
PlacementBottomOnScreenKeyboardPlacement?

Gets or sets the keyboard placement.
When omitted, uses the global keyboard placement.
ShowSpecialCharactersKeyfalsebool

Gets or sets whether text keyboards should show a key that toggles special characters.
When omitted, uses the global special character key option.
SpecialCharactersRowsBuilt-in rowsIReadOnlyList<IReadOnlyList<OnScreenKeyboardKey>>

Gets or sets the rows used when the special characters keyboard is active.
When omitted, uses globally configured rows, then the built-in special character rows.

BaseOnScreenKeyboardInputComponent

ParameterDefaultType
AriaDescribedBy—string

Specifies the aria-describedby attribute value.
When set, this value is rendered as-is and overrides help and validation message ids generated by Field and Validation.
AriaInvalid—string

Specifies the aria-invalid attribute value.
When set, this value is rendered as-is and overrides the validation-derived aria-invalid state.
AriaLabelledBy—string

Specifies the aria-labelledby attribute value.
When set, this value is rendered as-is. Some non-labelable controls can otherwise derive it automatically from a parent FieldLabel or FieldsLabel.
AriaRequiredfalsebool

Specifies the aria-required attribute value.
When set, this value overrides the required-field state resolved from the parent Validation.
Autofocusfalsebool

Set's the focus to the component after the rendering is done.
ChildContentnullRenderFragment

Specifies the content to be rendered inside this BaseOnScreenKeyboardInputComponent.
Disabledfalsebool

Add the disabled boolean attribute on an input to prevent user interactions and make it appear lighter.
FeedbacknullRenderFragment

Placeholder for validation messages.
OnScreenKeyboardfalsebool

Enables the on-screen keyboard for this input component. When not explicitly set, the global accessibility option is used.
When omitted, uses the global accessibility setting and enabled input types.
OnScreenKeyboardEnterKeyBehaviorInput-dependentOnScreenKeyboardEnterKeyBehavior

Specifies how the on-screen keyboard enter key should behave for this input component.
Possible values:DefaultNewLineSubmitHideKeyDown
When omitted, uses the cascading override, then the global option, then the input component's behavior.
OnScreenKeyboardLayoutInput-dependentOnScreenKeyboardLayout

Specifies the on-screen keyboard layout for this input component. When not explicitly set, the global accessibility option is used.
Possible values:TextNumericDecimalEmailUrlTelephone
When omitted, uses the global default layout, then the input component's layout.
OnScreenKeyboardShowModeFocusOnScreenKeyboardShowMode

Gets or sets how the on-screen keyboard is shown for this input.
Possible values:DefaultFocusManual
When omitted, uses the global show mode; Default resolves to Focus.
ReadOnlyfalsebool

Add the readonly boolean attribute on an input to prevent modification of the input’s value.
SizeDefaultSize?

Sets the size of the input control.
When omitted, uses the parent Addons size, then the theme input size, then Size.Default.
TabIndexnullint?

If defined, indicates that its element can be focused and can participates in sequential keyboard navigation.
ValuenullTValue

Specifies the value inside the input field.
ValueExpressionnullExpression<Func<TValue>>

Specifies an expression that identifies the input value.

BlazoriseOnScreenKeyboardOptions

ParameterDefaultType
AutoScrolltruebool

If true, the focused input is scrolled into view when it would be covered by the on-screen keyboard.
AutoScrollMargin12int

Gets or sets the viewport margin, in pixels, kept between the focused input and the on-screen keyboard during automatic scrolling.
DefaultLayoutnullOnScreenKeyboardLayout?

Gets or sets the default keyboard layout. When not set, each input component chooses its own layout.
Enabledfalsebool

If true, input components can show the on-screen keyboard when they receive focus.
EnterKeyBehaviorDefaultOnScreenKeyboardEnterKeyBehavior

Gets or sets how the on-screen keyboard enter key should behave.
Possible values:DefaultNewLineSubmitHideKeyDown
HideOnBlurtruebool

If true, the on-screen keyboard is hidden when the active input loses focus.
HideOnEntertruebool

If true, the on-screen keyboard is hidden when the enter key is pressed.
InputTypesOnScreenKeyboardInputType.Text | OnScreenKeyboardInputType.NumericOnScreenKeyboardInputType

Gets or sets the input types enabled by the global on-screen keyboard option.
Possible values:NoneTextNumericDateTimePickersAll
KeyboardSizeMediumOnScreenKeyboardSize

Gets or sets the default keyboard visual width.
Possible values:FullWidthSmallMediumLarge
KeyLayoutCenteredOnScreenKeyboardKeyLayout

Gets or sets the default key arrangement inside keyboard rows.
Possible values:StretchCentered
KeyMinHeightnullint?

Gets or sets the key minimum height, in pixels.
KeyWidthnullint?

Gets or sets the base key width, in pixels, used by centered key layout.
PlacementBottomOnScreenKeyboardPlacement

Gets or sets the default keyboard placement.
Possible values:BottomTopInline
ShowModeFocusOnScreenKeyboardShowMode

Gets or sets how the on-screen keyboard is shown for enabled input components.
Possible values:DefaultFocusManual
ShowSpecialCharactersKeyfalsebool

If true, the text keyboard includes a key that toggles special characters.
SpecialCharactersRowsnullIReadOnlyList<IReadOnlyList<OnScreenKeyboardKey>>

Gets or sets the rows used when the special characters keyboard is active.

Events

OnScreenKeyboardProvider

EventType
LayoutProviderFunc<OnScreenKeyboardContext, IReadOnlyList<IReadOnlyList<OnScreenKeyboardKey>>>

Gets or sets a function that resolves keyboard rows for the active input context.
When omitted, uses the global layout provider, then the built-in layout.

BaseOnScreenKeyboardInputComponent

EventType
BlurEventCallback<FocusEventArgs>

The blur event fires when an element has lost focus.
CustomValidationValueFunc<TValue>

Used to provide custom validation value on which the validation will be processed with the Validator handler.
Should be used carefully as it's only meant for some special cases when input is used in a wrapper component, like Autocomplete or SelectList.
FocusInEventCallback<FocusEventArgs>

Notifies when the input box gains focus.
FocusOutEventCallback<FocusEventArgs>

Notifies when the input box loses focus.
KeyDownEventCallback<KeyboardEventArgs>

Notifies when a key is pressed down while the control has focus.
KeyPressEventCallback<KeyboardEventArgs>

Notifies when a key is pressed while the control has focus.
KeyUpEventCallback<KeyboardEventArgs>

Notifies when a key is released while the control has focus.
OnFocusEventCallback<FocusEventArgs>

Notifies when the input box gains or loses focus.
ValueChangedEventCallback<TValue>

Occurs after value has changed.

BlazoriseOnScreenKeyboardOptions

EventType
LayoutProviderFunc<OnScreenKeyboardContext, IReadOnlyList<IReadOnlyList<OnScreenKeyboardKey>>>

Gets or sets a function that resolves keyboard rows for a focused input.
LayoutSelectorFunc<OnScreenKeyboardContext, OnScreenKeyboardLayout>

Gets or sets a function that resolves the keyboard layout for a focused input.
ShouldShowFunc<OnScreenKeyboardContext, bool>

Gets or sets a predicate that decides if the keyboard should be shown for a focused input.

Methods

BaseOnScreenKeyboardInputComponent

MethodReturnParameters
ShowOnScreenKeyboardTaskbool focus

Shows the on-screen keyboard for this input.
FocusTaskbool scrollToElement

Sets the focus on the underline element.
RevalidateTask—

Forces the Validation (if any is used) to re-validate with the new custom or internal value.