1.0.11 • Published 7 months ago

sagar-image-text v1.0.11

Weekly downloads
-
License
-
Repository
github
Last release
7 months ago

1. Library usage example

https://sagargi.github.io/sagar-image-text

2. Installation

SagarImageText is available on NPM. You can install it using the following command:

npm i sagar-image-text

After installing the package, you import and directly use it on you vue code as:

import { ImageText, ImageTextCoordinate } from "sagar-image-text";
import 'sagar-image-text/style.css'

3. Getting Started

Here is the minimal example:

This is the example of component ImageText which is very basic.

<template>
  <div class="wrapper">
      <ImageText
          image-src="<path-to-image>"
          text="Your text here"
          text-position="bottom-left"
      />
  </div>
</template>

Also, here is an example of component ImageTextCoordinate which is more flexible than ImageText

<template>
  <div class="wrapper">
      <ImageTextCoordinate
          image-src="<path-to-image>"
          text="Your text here"
          image_x_coordinate="50"
          image_y_coordinate="50"
      />
  </div>
</template>

4. Props

Component ImageText has the following props:

PropTypeDefaultDescription
imageSrcStringrequiredPath to the source of the image.
imageWidthString100%Width of the image.
imageHeightStringautoHeight of the image.
textStringyour text hereText you want to display.
textColorStringwhiteColor of the text on image.
textSizeString10pxFont size of the text on image.
textPositionStringcenterPosition to keep the text. (top-left, top-right, top-center, bottom-left, bottom-right, bottom-center and center )
textBackgroundColorStringrgba(0, 0, 0, 0.5)Background of the text
imageBorderRadiusString0pxSet the border radius of the image.
textFontStyleStringArial, Helvetica, sans-serif;Set the font style for the text on image.
textFontFamilyStringnormalSet the font for the text on image.

Component ImageTextCoordinate has same props as above but with extra props as:

PropTypeDefaultDescription
image_x_coordinateNumber50x-positon to place the text on image.
image_y_coordinateNumber50y-positon to place the text on image.
textAlignStringcenterAlso allows to align the position of the text on an overlay (left, right and center).
textBackgroundWidthNumbernumberWidth of the text background.
1.0.11

7 months ago

1.0.10

7 months ago

1.0.9

7 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago