Skip to content

Signature Text

Generate text to signature image

Usage

Simple Usage

preview
vue
<template>
  <p-signature-text text="Lorem Ipsum" />
</template>

for Initial

preview
vue
<template>
  <p-signature-text text="Lorem Ipsum" :width="230" :limit="1" />
</template>

Change Font

You can the font using prop font, it importing font from Google Font, default is Herr Von Muellerhoff

preview
vue
<template>
  <p-signature-text text="Lorem Ipsum" font="Herr Von Muellerhoff"/>
  <p-signature-text text="Lorem Ipsum" font="Satisfy"/>
</template>

Max Words

Limit the text word using maxwords, default is 2

preview
vue
<template>
  <p-signature-text text="Lorem ipsum dolor sit amet" maxwords="3" />
  <p-signature-text text="Lorem ipsum dolor sit amet" maxwords="2" />
  <p-signature-text text="Lorem ipsum dolor sit amet" maxwords="1" />
</template>

Max Length

Limit the text length using maxlength, default is 50

preview
vue
<template>
  <p-signature-text text="Lorem Aaaaaaaaaaaaaaaaaaaaaaaaaaaaa" maxlength="15" />
</template>

Color

preview
vue
<template>
  <p-signature-text text="Lorem ipsum" color="#004C9D" />
  <p-signature-text text="Lorem ipsum" color="#23B242" />
  <p-signature-text text="Lorem ipsum" color="#E42E2C" />
</template>

Binding v-model

You can bind the generated result with v-model.

preview
vue
<template>
  <p-signature-text v-model="result" />
</template>

<script lang="ts" setup>
const result = ref<File>()
</script>

result

Encode to base64

If you prefer base64-dataURI format, add modifier .base64 to your v-model.

preview

result

vue
<template>
  <p-signature-text text="Lorem ipsum" v-model.base64="result" />
</template>

<script lang="ts" setup>
const result = ref('')
</script>

API

Props

PropsTypeDefaultDescription
widthNumber430Image's width
heightNumber230Image's width
textString-Image's text
maxlimitNumber2Maximal word to be generated
maxlengthNumber50Maximal text length
fontStringHerr Von MuellerhoffText font, imported from Google Font
colorString#000000Text color
modelValueString-Result of generated image

Slots

NameDescription
There no slots here

Events

NameArgumentsDescription
There no props here

Released under the MIT License.