Blazor.SignaturePad 8.0.0

dotnet add package Blazor.SignaturePad --version 8.0.0
NuGet\Install-Package Blazor.SignaturePad -Version 8.0.0
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="Blazor.SignaturePad" Version="8.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazor.SignaturePad --version 8.0.0
#r "nuget: Blazor.SignaturePad, 8.0.0"
#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.
// Install Blazor.SignaturePad as a Cake Addin
#addin nuget:?package=Blazor.SignaturePad&version=8.0.0

// Install Blazor.SignaturePad as a Cake Tool
#tool nuget:?package=Blazor.SignaturePad&version=8.0.0

SignaturePad

A simple to use blazor component to draw a signature. It supports both mouse and touch inputs and works on Blazor Server and Blazor WebAssembly.

See a live demo right here on github.

SignaturePad Demo

Installation

You can install from Nuget using the following command:

Install-Package Blazor.SignaturePad

Or via the Visual Studio package manger.

Basic usage

Start by adding the following using statement to your root _Imports.razor.

@using SignaturePad

Next you should define a property in your class. For example:

public class MyInput
{
    public byte[] Signature { get; set; } = Array.Empty<byte>();
}

You can then use it wherever you want.

    <SignaturePad @bind-Value="Input.Signature" style="width: 100%" />

The control provides you the image data as base64 byte[]

To get the image, you'll need to convert to byte[] into a string. For example:

public class MyInput
{
    public byte[] Signature { get; set; }
    public string SignatureAsBase64 => System.Text.Encoding.UTF8.GetString(Signature);
}

Providing options

You can configure the SignaturePad by providing a SignaturePadOptions instance to the component.

<SignaturePad @bind-Value="Input.Signature" Options="_options" style="width: 100%" />

@code {
    public MyInput Input { get; set; } = new();

    private SignaturePadOptions _options = new SignaturePadOptions
    {
        LineCap = LineCap.Round,
        LineJoin = LineJoin.Round,
        LineWidth = 20
    };
}

Custom styling

You can customize the looks of SignaturePad by either overriding the CSS classes or by specifiying your own classes.

For the SignaturePad itself you can use the Class parameter and for the button to clear the SignaturePad you can use the ClearButtonClass parameter.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.0 4,461 11/20/2023
7.5.0 1,824 11/6/2023
7.4.2 1,812 9/4/2023
7.4.1 344 8/30/2023
7.4.0 1,578 6/30/2023
7.3.0 810 6/14/2023
7.2.0 199 6/12/2023
7.1.2 211 6/7/2023
7.1.1 2,132 4/12/2023
7.1.0 260 4/11/2023
7.0.4 230 4/4/2023
7.0.3 842 3/13/2023
7.0.2 327 2/23/2023
7.0.1 457 11/29/2022