Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saade/filament-autograph
A Filament package to collect signatures.
https://github.com/saade/filament-autograph
autograph filament form-builder laravel signature signaturepad
Last synced: 13 days ago
JSON representation
A Filament package to collect signatures.
- Host: GitHub
- URL: https://github.com/saade/filament-autograph
- Owner: saade
- License: mit
- Created: 2023-08-20T22:04:00.000Z (over 1 year ago)
- Default Branch: 3.x
- Last Pushed: 2024-07-08T06:36:15.000Z (6 months ago)
- Last Synced: 2025-01-03T11:19:55.607Z (15 days ago)
- Topics: autograph, filament, form-builder, laravel, signature, signaturepad
- Language: PHP
- Homepage: https://filamentphp.com/plugins/saade-autograph
- Size: 828 KB
- Stars: 48
- Watchers: 1
- Forks: 9
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Filament Autograph
[![Latest Version on Packagist](https://img.shields.io/packagist/v/saade/filament-autograph.svg?style=flat-square)](https://packagist.org/packages/saade/filament-autograph)
[![Total Downloads](https://img.shields.io/packagist/dt/saade/filament-autograph.svg?style=flat-square)](https://packagist.org/packages/saade/filament-autograph)
## Installation
You can install the package via composer:
```bash
composer require saade/filament-autograph
```## Usage
```php
use Saade\FilamentAutograph\Forms\Components\SignaturePad;SignaturePad::make('signature')
```## Configuration
### SignaturePad options.
> For reference: [https://github.com/szimek/signature_pad#options](https://github.com/szimek/signature_pad#options)
```php
use Saade\FilamentAutograph\Forms\Components\SignaturePad;SignaturePad::make('signature')
->label(__('Sign here'))
->dotSize(2.0)
->lineMinWidth(0.5)
->lineMaxWidth(2.5)
->throttle(16)
->minDistance(5)
->velocityFilterWeight(0.7)
```### Customizing the pad background and pen color.
```php
use Saade\FilamentAutograph\Forms\Components\SignaturePad;SignaturePad::make('signature')
->backgroundColor('rgba(0,0,0,0)') // Background color on light mode
->backgroundColorOnDark('#f0a') // Background color on dark mode (defaults to backgroundColor)
->exportBackgroundColor('#f00') // Background color on export (defaults to backgroundColor)
->penColor('#000') // Pen color on light mode
->penColorOnDark('#fff') // Pen color on dark mode (defaults to penColor)
->exportPenColor('#0f0') // Pen color on export (defaults to penColor)
```### Allow download of the signature.
```php
use Saade\FilamentAutograph\Forms\Components\SignaturePad;
use Saade\FilamentAutograph\Forms\Components\Enums\DownloadableFormat;SignaturePad::make('signature')
->filename('autograph') // Filename of the downloaded file (defaults to 'signature')
->downloadable() // Allow download of the signature (defaults to false)
->downloadableFormats([ // Available formats for download (defaults to all)
DownloadableFormat::PNG,
DownloadableFormat::JPG,
DownloadableFormat::SVG,
])
->downloadActionDropdownPlacement('center-end') // Dropdown placement of the download action (defaults to 'bottom-end')
```### Disabling clear, download, undo and done actions.
```php
use Saade\FilamentAutograph\Forms\Components\SignaturePad;SignaturePad::make('signature')
->clearable(false)
->downloadable(false)
->undoable(false)
->confirmable(false)
```### Requiring confirmation (Done button).
```php
SignaturePad::make('signature')
->confirmable() // Requires user to click on 'Done' (defaults to false)
```### Customizing actions
```php
use Saade\FilamentAutograph\Forms\Components\SignaturePad;
use Filament\Forms\Actions\Action;SignaturePad::make('signature')
->clearAction(fn (Action $action) => $action->button())
->downloadAction(fn (Action $action) => $action->color('primary'))
->undoAction(fn (Action $action) => $action->icon('heroicon-o-ctrl-z'))
->doneAction(fn (Action $action) => $action->iconButton()->icon('heroicon-o-thumbs-up'))
```
## ChangelogPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Saade](https://github.com/saade)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.