Soenneker.Blazor.CreditCards
4.0.661
Prefix Reserved
dotnet add package Soenneker.Blazor.CreditCards --version 4.0.661
NuGet\Install-Package Soenneker.Blazor.CreditCards -Version 4.0.661
<PackageReference Include="Soenneker.Blazor.CreditCards" Version="4.0.661" />
<PackageVersion Include="Soenneker.Blazor.CreditCards" Version="4.0.661" />
<PackageReference Include="Soenneker.Blazor.CreditCards" />
paket add Soenneker.Blazor.CreditCards --version 4.0.661
#r "nuget: Soenneker.Blazor.CreditCards, 4.0.661"
#:package Soenneker.Blazor.CreditCards@4.0.661
#addin nuget:?package=Soenneker.Blazor.CreditCards&version=4.0.661
#tool nuget:?package=Soenneker.Blazor.CreditCards&version=4.0.661
Soenneker.Blazor.CreditCards
An animated Blazor credit-card visualizer with network detection, masked saved-card display, custom styling, and front/back flipping.
This is a display component, not a payment field. It does not tokenize, validate with Luhn, encrypt, or submit card data. Use a PCI-compliant hosted payment control such as Stripe Elements for real payment entry.
Installation and registration
dotnet add package Soenneker.Blazor.CreditCards
using Soenneker.Blazor.CreditCards.Registrars;
builder.Services.AddCreditCardsInteropAsScoped();
Display a saved card
Prefer the last-four API for production account screens:
<CreditCard @ref="_card"
CardHolderName="Ada Lovelace"
ExpiryDate="12/29"
FlipEnabled="true" />
@code {
private CreditCard? _card;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
await _card!.SetLast4("4242", type: "visa");
}
}
SetLast4 requires exactly four digits. ResetCardDetection() exits saved-card mode so subsequent CardNumber updates can select the visual style again.
Bind preview values
<CreditCard CardNumber="@cardNumber"
CardHolderName="@cardholderName"
ExpiryDate="@expiryDate"
Cvc="@cvc"
MaskSensitiveData="true"
Type="@cardType"
@ref="_card" />
MaskSensitiveData defaults to true: only the final four number digits are rendered, and the CVC is always replaced with bullets. Setting it to false renders supplied values into the page DOM and should be limited to test data and controlled demonstrations. Passing sensitive values through Blazor parameters still places them in application memory even when the display is masked; do not use this component as the owner of real PAN or CVC input.
When Type is blank, the component detects supported networks from a complete number after removing formatting characters. Supplying Type overrides detection. Detection identifies a visual network pattern only; it does not prove that a card number is valid or usable.
For input controls that update outside normal parameter binding, call:
await _card!.OnAnyInput(cardNumber, cardholderName, expiryDate, cvc);
Flip and click behavior
With no OnClick handler, clicking flips the card when FlipEnabled is true. Supplying OnClick replaces that default behavior; call Flip() inside the handler if the click should still flip it.
<CreditCard OnClick="HandleClick" @ref="_card" />
@code {
private void HandleClick(MouseEventArgs _)
{
_card?.Flip();
}
}
Brand artwork is loaded from jsDelivr. Allow https://cdn.jsdelivr.net in the image policy when using a Content Security Policy. The component removes its JavaScript observer when disposed.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 10.0.13)
- Soenneker.Asyncs.Initializers (>= 4.0.128)
- Soenneker.Blazor.Utils.ResourceLoader (>= 4.0.1788)
- Soenneker.Lepton.Suite (>= 4.0.115)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Blazor.CreditCards:
| Package | Downloads |
|---|---|
|
Soenneker.Quark.Suite
Shadcn-powered Blazor UI, refined and modular. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.661 | 0 | 10/14/2026 |
| 4.0.660 | 0 | 10/14/2026 |
| 4.0.658 | 0 | 10/14/2026 |
| 4.0.657 | 0 | 10/14/2026 |
| 4.0.655 | 5 | 10/14/2026 |
| 4.0.653 | 43 | 10/14/2026 |
| 4.0.652 | 43 | 10/14/2026 |
| 4.0.646 | 68 | 10/13/2026 |
| 4.0.644 | 66 | 10/12/2026 |
| 4.0.640 | 474 | 10/12/2026 |
| 4.0.639 | 68 | 10/12/2026 |
| 4.0.638 | 73 | 10/12/2026 |
| 4.0.637 | 70 | 10/12/2026 |
| 4.0.635 | 71 | 10/11/2026 |
| 4.0.634 | 70 | 10/11/2026 |
| 4.0.633 | 71 | 10/11/2026 |
| 4.0.632 | 74 | 10/11/2026 |
| 4.0.631 | 78 | 10/11/2026 |
| 4.0.630 | 3,497 | 10/7/2026 |
| 4.0.629 | 1,183 | 10/3/2026 |
Updated Multiple NuGet packages