Customisation
The customization option of the constructor sets the appearance of the toolbar buttons and of the signature stroke:
new MobbSign({
...options,
customization: {
signButton: {color: '#361CC9'},
confirmButton: {theme: 'success'},
discardButton: {theme: 'danger'},
doneButton: {color: '#4B0082'},
stroke: {width: 2, color: '#1E1E99'},
},
});
Buttons
| Key | Button |
|---|---|
signButton | Sign. |
confirmButton | Confirm the signature. |
discardButton | Discard the signature. |
doneButton | Finish. |
Each button accepts a theme or a color. If you set both, theme is used.
Themes
| Theme | Colour |
|---|---|
primary | Blue |
success | Green |
warning | Yellow |
danger | Red |
info | Light blue |
light | Light |
dark | Dark |
Custom colour
color sets the colour of the icon and the label of the button, in hexadecimal format. The background of the button when it is hovered or pressed is calculated from that colour, by lightening it.
Signature stroke
Since version 2.1.1, stroke sets the stroke of the signature:
| Key | Default | Description |
|---|---|---|
width | 1 | Width of the stroke. |
color | #1E1E99 | Colour of the stroke, in hexadecimal format. |
Languages
The interface is available in English and Spanish. Select the language with the language option, using its ISO 639-1 code:
new MobbSign({...options, language: 'es'});
To add a language, create the file translation-{lang}.json in your locales/ folder, where {lang} is the ISO 639-1 code of the language. Use translation-en.json as a template:
locales/translation-fr.json
{
"mobbsign": {
"sign-tooltip": "Signer le document",
"annotate-tooltip": "Ajouter une annotation",
"discard-signature-tooltip": "Rejeter la signature",
"confirm-signature-tooltip": "Confirmer la signature",
"done-tooltip": "Terminer"
}
}