3.2.0 • Published 6 months ago

react-thumbnail-generator v3.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

💻 react-thumbnail-generator

Video 📷

Features 😁

  • Optimized for browsers. Limited availability on mobile.
  • Download thumbnail images
  • Resize the canvas
  • Fill the background with colors or pictures
  • Select a blur effect
  • Select font family, textAlign, size, stroke, color, angle, lineHeight
  • Drag and Drop text on the canvas
  • Add custom web font families
  • Select the modal button and its location
  • Choose the image type (png, jpg, webp, svg)
  • Support TypeScript and Next(v13)

Top Icons Feature

  • 1: Background Picture
  • 2: Text Align (start, center, end)
  • 2: Background Color
  • 3: Font Color
  • 4: Font Stroke Color
  • 5: Blur Effect

How to use React 😊

STEP 1️⃣

  • Install Package
yarn add react-thumbnail-generator
or
npm install react-thumbnail-generator

STEP 2️⃣

  • Add <ThumbnailGenerator> component.
  • ThumbnailGenerator is automatically rendered as a document.body child by default using Portal.
import ThumbnailGenerator from 'react-thumbnail-generator';
import iconImage from '../assets/colorImage.png';

const App = () => {
  return (
    <ThumbnailGenerator
      buttonIcon={<img src={iconImage} width={30} height={30} alt="iconImage" />}
      // To insert the inner icon of the button that opens the thumbnail modal, use the ReactNode. 
      // If you do not include this option, the default icon will be used.

      iconSize="medium"
      // Through this property, you can specify the size of the button icon.
      // However, if you are inserting a custom button icon, this option is meaningless.

      iconPosition={[0, 20, 20, 0]}
      // Through this property, you can specify the position of the button icon.
      // [top, right, bottom, left]

      modalPosition='right'
      // Through this property, you can specify the position of the thumbnail generator.
      
      additionalFontFamily={['Noto Sans', ...]}
      // You can add the font of your choice to your project, but that font must already applied to your project.

      isFullWidth={true}
      // Setting this property to true will make the thumbnail generator full-width.

      isDefaultOpen={false}
      // Setting this property to true will open the thumbnail generator by default.
    />
  )
}

How to add Web fonts 😊

STEP 1️⃣

  • Add a web font. public/index.html
  • or CSS fontFamily
<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- ... -->

    <!-- Add a web font -->
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link
      href="https://fonts.googleapis.com/css2?family=Zeyada&display=swap"
      rel="stylesheet"
    />
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>

STEP 2️⃣

  • Enter font names in array form in the AdditionalFontFamily option
import ThumbnailGenerator from 'react-thumbnail-generator';
import iconImage from '../assets/colorImage.png';

const App = () => {
  return (
    <ThumbnailGenerator 
      additionalFontFamily={["Zeyada"]} // (*)
    />
  )
}

API 📄

  • buttonIcon
    • Optional
    • Default:
    • Type: ReactNode
  • iconPosition
  • modalPosition
    • Optional
    • Default: right
    • Type:left | right | center
  • iconSize
    • Optional
    • Default: medium
    • Type: small | medium | large
  • additionalFontFamily
    • Optional
    • Type: string[]
  • isFullWidth
    • Optional
    • Default: false
    • Type: boolean
  • isDefaultOpen
    • Optional
    • Default: false
    • Type: boolean

Reference

3.2.0

6 months ago

3.1.1

7 months ago

3.0.4

10 months ago

3.0.3

10 months ago

3.0.2

10 months ago

3.0.1

10 months ago

2.9.2

11 months ago

2.9.1

11 months ago

2.9.4

11 months ago

2.9.3

11 months ago

3.0.0

10 months ago

2.9.5

11 months ago

2.10.1

11 months ago

2.10.0

11 months ago

2.9.0

11 months ago

3.1.0

8 months ago

2.8.0

1 year ago

2.7.1

1 year ago

2.7.0

1 year ago

2.6.6

1 year ago

0.2.0

1 year ago

2.6.5

1 year ago

2.6.4

1 year ago

2.6.3

1 year ago

2.6.2

1 year ago

2.6.1

1 year ago

2.6.0

1 year ago

2.5.0

1 year ago

2.4.4

1 year ago

2.4.3

1 year ago

2.4.2

1 year ago

2.4.1

1 year ago

2.4.0

1 year ago

2.3.1

1 year ago

2.3.0

1 year ago

2.2.0

1 year ago

2.1.1

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.2.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.1.18

1 year ago

0.1.17

1 year ago

0.1.16

1 year ago

0.1.15

1 year ago

0.1.14

1 year ago

0.1.13

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

6 years ago