Skip to main content
100%

Image as base64

✓ Published0🌍 Public
OOleksandr Poplavskyi
Last edited Nov 8, 2023
Created on Dec 28, 2020
Forked from React Starter

This example renders a single image whose source is a base64-encoded GIF string embedded directly in the code. It uses React to define an `App` component that returns an `<img>` element, with the `src` attribute constructed as a data URI by concatenating `data:image/gif;base64,` with the encoded string. ReactDOM mounts the component into the `#root` DOM element. The page loads React and ReactDOM from unpkg CDN scripts, and the visible result is the decoded GIF displayed at its natural size.

AI-generated description

An example of base64 image in react app

MIT Licensed

Similar vizzes