Skip to content

SecurityPin

A PIN entry control with individually rendered cells that captures input through a hidden Entry. Digits are visible by default and can optionally be masked with any character for password-style entry.

  • NuGet downloads for Shiny.Maui.Controls
SecurityPin
<!-- Visible 4-digit numeric PIN -->
<shiny:SecurityPin Length="4"
Value="{Binding Pin}"
Keyboard="Numeric" />
<!-- Masked 6-digit PIN with '*' -->
<shiny:SecurityPin Length="6"
HideCharacter="*"
Value="{Binding Pin}"
Keyboard="Numeric" />
<!-- Alphanumeric PIN masked with bullets -->
<shiny:SecurityPin Length="5"
HideCharacter="●"
Value="{Binding Pin}"
Keyboard="Default" />
<shiny:SecurityPin x:Name="Pin"
Length="4"
Value="{Binding Pin}"
Completed="OnPinCompleted" />
void OnPinCompleted(object? sender, SecurityPinCompletedEventArgs e)
{
var enteredValue = e.Value;
// verify the PIN
}
PropertyTypeDefaultDescription
Lengthint4Number of PIN cells
Valuestring""Current PIN value (TwoWay)
KeyboardKeyboardNumericKeyboard type for input
HideCharacterstring?nullWhen set, masks entered characters; when null or empty, shows actual values
CellSizedouble50Width/height of each cell
CellSpacingdouble8Space between cells
CellCornerRadiusdouble8Border corner radius
CellBorderColorColor?nullCell border color
CellFocusedBorderColorColor?nullBorder color for the active cell
CellBackgroundColorColor?nullCell fill color
CellTextColorColor?nullEntered character color
FontSizedouble24Character font size
EventArgsDescription
CompletedSecurityPinCompletedEventArgsFires when the entered value length reaches Length
MethodDescription
Focus()Focus the hidden Entry and bring up the keyboard
Unfocus()Dismiss the keyboard
Clear()Reset the value to empty
<shiny:SecurityPin Length="4"
HideCharacter="●"
CellSize="48"
CellSpacing="10"
CellCornerRadius="12"
CellBorderColor="LightGray"
CellFocusedBorderColor="DodgerBlue"
CellBackgroundColor="#F5F5F5"
CellTextColor="Black"
FontSize="22"
Value="{Binding Pin}" />
  • A hidden Entry captures keyboard input; tapping any cell focuses it and brings up the keyboard
  • MaxLength on the internal Entry is kept in sync with Length
  • Changing Length rebuilds the cells; a longer Value is truncated
  • The currently focused cell shows CellFocusedBorderColor when set
  • When HideCharacter is null or empty, the actual entered character is displayed
claude plugin marketplace add shinyorg/skills
claude plugin install shiny-maui@shiny

Coming soon — Copilot plugin install instructions will be added here.

View shiny-maui Plugin