Skip to main content

Virtual Keyboard Styling

The VirtualKeyboard control in Avalonia supports custom styling via named resources. You can override these resources in your application to customize the appearance of keyboard elements.

Customizable Resources

Virtual Keyboard Styles

Below is a list of key resources you can override in your theme or resource dictionary:

KeyTypeDefaultNotes
KeyboardActionButtonBackgroundBrushGoldenrod
KeyboardActionButtonBackgroundPressedBrushPaleGoldenrod
KeyboardButtonBackgroundBrushGhostWhite
KeyboardButtonBackgroundPressedBrushFloralWhite
KeyboardButtonBorderBrushBrushBlack
KeyboardButtonFontSizeDouble24introduced in 11.3.1
KeyboardButtonForegroundBrushBlack
KeyboardFunctionalButtonBackgroundBrushLightSteelBlue
KeyboardFunctionalButtonBackgroundPressedBrushLightBlue
KeyboardPaneBackgroundBrushDarkGray
KeyboardPanePaddingThickness4
KeyboardPopupKeySelectedBackgroundBrushPaleTurquoise

How to Override

To customize, define these resources in your application theme or resource dictionary. For example:

<SolidColorBrush x:Key="KeyboardButtonForeground" Color="#FF0000" />

Example: Custom Theme

<ResourceDictionary>
<SolidColorBrush x:Key="KeyboardPaneBackground" Color="#FFD700" />
<system:Double x:Key="KeyboardButtonFontSize">36</system:Double>
<!-- Add more overrides as needed -->
</ResourceDictionary>

See Also