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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Blazor.CreditCards" Version="4.0.661" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.CreditCards" Version="4.0.661" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.CreditCards" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Blazor.CreditCards --version 4.0.661
                    
#r "nuget: Soenneker.Blazor.CreditCards, 4.0.661"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Blazor.CreditCards@4.0.661
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Blazor.CreditCards&version=4.0.661
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.CreditCards&version=4.0.661
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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.

Credit card component

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed

Updated Multiple NuGet packages