# react-thumbnail-generator

> react-thumbnail-generator

Latest version **4.2.0** (published 2026-03-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-thumbnail-generator
pnpm add react-thumbnail-generator
yarn add react-thumbnail-generator
bun add react-thumbnail-generator
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.2.0 |
| Published | 2026-03-17 |
| First published | 2023-02-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=24 |
| Dependencies | 7 |
| Unpacked size | 572.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Author | Gromit |
| Maintainers | ssi02014 |
| Keywords | react, next, react-thumbnail-generator, thumbnail, image, banner, icon, generator, style, img, png, jpg, webp |

## Links

- npm: https://www.npmjs.com/package/react-thumbnail-generator
- Repository: https://github.com/ssi02014/react-thumbnail-generator
- Homepage: http://ssi02014.github.io/react-thumbnail-generator
- Issues: https://github.com/ssi02014/react-thumbnail-generator.git/issues
- npm.io page: https://npm.io/package/react-thumbnail-generator

## Dependencies (7)

- [clsx](https://npm.io/package/clsx.md) ^2.1.1
- [konva](https://npm.io/package/konva.md) ^9.3.22
- [react-konva](https://npm.io/package/react-konva.md) ^19.0.7
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.14.0
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) ^11.14.1
- [@modern-kit/react](https://npm.io/package/@modern-kit/react.md) ^2.5.0
- [react-color-palette](https://npm.io/package/react-color-palette.md) ^7.3.0

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [stockfish](https://npm.io/package/stockfish.md) — 27.0K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads

## Recent versions

- 4.2.0 (latest) — 2026-03-17
- 3.6.0 (v3-latest) — 2026-03-17
- 3.5.2 — 2025-08-24
- 4.1.2 — 2025-08-24
- 4.1.1 — 2025-08-21
- 3.5.1 — 2025-08-21
- 4.1.0 — 2025-08-21
- 3.5.0 — 2025-08-21
- 4.0.6 — 2025-07-27
- 4.0.5 — 2025-07-27
- 3.4.0 — 2025-07-27
- 4.0.4 — 2025-07-24
- 4.0.3 — 2025-07-24
- 4.0.2 — 2025-07-24
- 4.0.1 — 2025-07-24
- … 74 more at https://npm.io/package/react-thumbnail-generator/versions

## README

# 💻 react-thumbnail-generator
English | [한국어](README-ko_kr.md) | [简体中文](README-zh_cn.md) | [日本語](README-ja_jp.md)

<a href="https://www.npmjs.com/package/react-thumbnail-generator" target="_blank">
  <img src="https://img.shields.io/npm/v/react-thumbnail-generator.svg">
</a>
<a href="https://www.npmjs.com/package/react-thumbnail-generator" target="_blank">
  <img src="https://img.shields.io/npm/dt/react-thumbnail-generator.svg">
</a>
<a href="https://bundlephobia.com/package/react-thumbnail-generator" target="_blank">
  <img src="https://img.shields.io/bundlephobia/minzip/react-thumbnail-generator/latest?style=flat-square">
</a>


<p>
  <a href="https://www.npmjs.com/package/react-thumbnail-generator" target="_blank">
    <img src="https://user-images.githubusercontent.com/64779472/219855230-d6515d16-334c-432a-8d20-fa171e17c231.png" />
  </a>
</p>

## Overview 🎨
`react-thumbnail-generator` is a versatile React component that allows you to easily create and customize thumbnails directly in your web browser. With an intuitive interface and rich feature set, you can generate  thumbnails for your projects without leaving your application.

https://github.com/user-attachments/assets/5d4f8c23-72c6-43ae-aa62-5c46ee0ddfc6

<br />

### Key Features
- 🎯 Multi-layer system with drag, rotate, and resize per layer
- 🖼️ Support for both text and image layers
- 🎨 Background color/image customization with auto-resize
- ✍️ Per-layer text styling (font, size, color, stroke, alignment)
- ↩️ Undo / Redo with keyboard shortcuts (Ctrl+Z / Ctrl+Shift+Z)
- 📏 Flexible canvas sizing with boundary guard
- 💾 Multiple export formats (PNG, JPG, WebP)
- 📱 Mobile responsive layout

<br />

## Demo Page 🖼️
[react-thumbnail-generator demo page](https://ssi02014.github.io/react-thumbnail-generator/?path=/story/components-thumbnailgenerator--default)

<br />

## Version Compatibility 🔄
react-thumbnail-generator `v4` supports `react/react-dom v19`.

If you are using react v18, please use version `v3`.

```shell
yarn add react-thumbnail-generator@^3
```
```shell
pnpm add react-thumbnail-generator@^3
```
```shell
npm install react-thumbnail-generator@^3
```

<br />

## Quick Start 🚀
### STEP 1️⃣
- Install Package
```shell
yarn add react-thumbnail-generator
```
```shell
pnpm add react-thumbnail-generator
```

```shell
npm install react-thumbnail-generator
```

<br />

### STEP 2️⃣
- Add `<ThumbnailGenerator>` component.
- ThumbnailGenerator is automatically rendered as a `document.body` child by default using `Portal`.

```jsx
import ThumbnailGenerator from 'react-thumbnail-generator';

const App = () => {
  return (
    <ThumbnailGenerator
      iconPosition="bottom-right"
      // Specify the position of the toggle button icon (top-left, top-right, bottom-left, bottom-right)

      modalPosition="right"
      // Specifies the position where the thumbnail generator will be displayed (left, right, center)

      additionalFontFamily={['Noto Sans', ...]}
      // Add custom fonts to use in the generator
      // Important: Fonts must be already loaded in your project to work

      isFullWidth={true}
      // Makes the thumbnail generator expand to full width when true

      isDefaultOpen={false}
      // Opens the thumbnail generator automatically on load when true
    />
  )
}
```

<br />

## How to add Web Fonts 😊
### STEP 1️⃣
- Add a web font in `public/index.html` or `index.html`
- Or import web fonts in your `CSS/SCSS` files

```html
<!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>
```

<br />

### STEP 2️⃣
- Add font names as an array to the `additionalFontFamily` prop
- The font names must match exactly with the loaded web fonts

```jsx
import ThumbnailGenerator from 'react-thumbnail-generator';

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

<br />

## Options 📄

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `iconPosition` | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | `'bottom-right'` | Position of the toggle button icon |
| `modalPosition` | `'left' \| 'right' \| 'center'` | `'right'` | Position where the thumbnail generator modal is displayed |
| `additionalFontFamily` | `string[]` | `-` | Custom fonts to add to the generator (must be pre-loaded) |
| `isFullWidth` | `boolean` | `false` | Expands the generator to full width |
| `isDefaultOpen` | `boolean` | `false` | Opens the generator automatically on load |

<br />

## Contributing

Thank you for your contribution. ❤️ Anyone can contribute to `react-thumbnail-generator`.

<a href="https://github.com/ssi02014/react-thumbnail-generator/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=ssi02014/react-thumbnail-generator">
</a>

<br />

## License
MIT © ssi02014. See [LICENSE](./LICENSE) for details.

---
_Source: https://npm.io/package/react-thumbnail-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
