🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@unitools/image

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unitools/image

This is the official documentation of the `@unitools/image` package.

0.0.5
latest
npm
Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

@unitools/image [ALPHA]

This is the official documentation of the @unitools/image package.

For Next.js

Installation

npm install @unitools/image
npm install -D @unitools/babel-plugin-image

or

yarn add @unitools/image
yarn add -D @unitools/babel-plugin-image

Add module resolver to your next.config.js file.

// next.config.js

module.exports = {
  webpack(config) {
    config.resolve.alias["@unitools/image"] = "next/image";
    return config;
  },
};

For Expo

Installation

npm install @unitools/image expo-image
npm install -D @unitools/babel-plugin-image

or

yarn add @unitools/image expo-image
yarn add -D @unitools/babel-plugin-image

Add babel plugin to your babel.config.js file.

// babel.config.js

module.exports = {
  plugins: [
    [
      "@unitools/babel-plugin-image",
      {
        assets: "src/assets", // Path to your assets folder where images are stored
      },
    ],
  ],
};

Usage

import Image from "@unitools/image";

export default function Home() {
  return (
    <View>
      <Image src="/logo.png" alt="Logo" width={200} height={200} />
    </View>
  );
}

Props

PropTypeDefaultDescriptionStatusSupport Status
srcstring | NextImage TypeImage sourcerequired
altstringImage alt textrequired
widthnumberImage widthrequired
heightnumberImage heightrequired
loaderstringImage loader-
fillstringImage fill-
sizesstringImage sizes-
qualitynumber (integer 1-100)Image quality-
prioritybooleanImage priority-
placeholderstringImage placeholder-
styleobjectImage style-
onErrorfunctionError function-
onLoadfunctionLoad function-
onLoadingCompletefunctionCallback function-
loadingstringImage loading-
blurDataURLstringImage blur data-

FAQs

Package last updated on 05 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts