# RadzenSignaturePad Class

A signature pad component that allows users to draw a signature using mouse, touch, or pen input. The signature is captured as a base64-encoded PNG data URL. Supports data binding, validation, and form integration.

Namespace: [Radzen.Blazor](https://blazor.radzen.com/docs/api/Radzen.Blazor.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- ComponentBase
- [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md)
- [FormComponent<string>](https://blazor.radzen.com/docs/api/Radzen.FormComponent-1.md)
- RadzenSignaturePad

## Implements

- IComponent
- IHandleEvent
- IHandleAfterRender
- [IRadzenFormComponent](https://blazor.radzen.com/docs/api/Radzen.IRadzenFormComponent.md)

## Syntax

```csharp
public class RadzenSignaturePad : FormComponent<string>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent
```

## Examples

Basic usage with two-way binding:

```razor
<RadzenSignaturePad @bind-Value=@signature />
```

With custom size and stroke:

```razor
<RadzenSignaturePad @bind-Value=@signature Style="width: 500px; height: 200px;" StrokeColor="#000" StrokeWidth="2" />
```

## Constructors

| Constructor | Description |
|-------------|-------------|
| `public RadzenSignaturePad()` | A signature pad component that allows users to draw a signature using mouse, touch, or pen input. The signature is captured as a base64-encoded PNG data URL. Supports data binding, validation, and form integration. |

## Properties

| Property | Type | Description |
|------|------|-------------|
| AllowClear | `bool` | Gets or sets a value indicating whether the user can clear the signature. Set to true by default. |
| ClearAriaLabel | `string` | Gets or sets the accessible label text for the clear button. |
| ReadOnly | `bool` | Gets or sets whether the signature pad is read-only. |
| StrokeColor | `string` | Gets or sets the stroke color used for drawing. |
| StrokeWidth | `double` | Gets or sets the width of the stroke in pixels. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `BuildRenderTree(Rendering.RenderTreeBuilder __builder)` | `void` |  |
| `Clear()` | `Task` | Clears the signature pad. |
| `Dispose()` | `void` |  |
| `GetComponentCssClass()` | `string` |  |
| `OnAfterRenderAsync(bool firstRender)` | `Task` |  |
| `OnStrokeEnd(string dataUrl)` | `Task` | Called from JavaScript when the user finishes drawing a stroke. Parameters: `dataUrl`: The base64-encoded PNG data URL of the signature. |
| `SetParametersAsync(ParameterView parameters)` | `Task` |  |

## Inherited Members

- From [FormComponent<string>](https://blazor.radzen.com/docs/api/Radzen.FormComponent-1.md): Change, CurrentPlaceholder, Disabled, EditContext, FieldIdentifier, FocusAsync, Form, FormFieldContext, FormFieldLabelledBy, GetClassList, GetValue, HasValue, IsBound, LabelTargetId, LabelToLink, LinkLabelAsync, Name, NotifyFieldChanged, OnContextMenu, Placeholder, ShouldLinkLabel, TabIndex, Value, ValueChanged, ValueExpression, _value
- From [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md): AddContextMenu, Attributes, ContextMenu, Culture, CurrentStyle, Debounce, DefaultCulture, DefaultUICulture, Element, GetCssClass, GetId, GetIdAttribute, IsJSRuntimeAvailable, JSRuntime, Localize, MouseEnter, MouseLeave, OnBecameInvisible, OnInitialized, OnMouseEnter, OnMouseLeave, RaiseContextMenu, RaiseMouseEnter, RaiseMouseLeave, Reference, Style, UICulture, UniqueID, Visible
- From ComponentBase: Assets, AssignedRenderMode, DispatchExceptionAsync, InvokeAsync, OnAfterRender, OnInitializedAsync, OnParametersSet, OnParametersSetAsync, RendererInfo, ShouldRender, StateHasChanged

