![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@keyvaluesystems/react-multi-inline-images
Advanced tools
A customizable ready to use Multiple Inline Image stack for React
Try tweaking a dot matrix using this codesandbox link here
The easiest way to use react-multi-inline-images is to install it from npm and build it into your app with Webpack.
npm install @keyvaluesystems/react-multi-inline-images
You’ll need to install React separately since it isn't included in the package.
React Multi Inline Images can run in a very basic mode by just providing the data
like given below:
import InlineImages from '@keyvaluesystems/react-multi-inline-images';
<InlineImages
data={dataArray}
/>
The data is an array of objects with the following keys:
name
- a string that represents each user's nameavatarUrl
- a string to specify the user imageAn example for data array is shown below:
const dataArray = [
{
name: 'Jon Dew',
avatarUrl: 'example.svg'
},
{
name: 'Jack'
}
];
If no avatarUrl is specified for the user, following default Image will be considered.
You can specify whether to add an elivation effect or to show name on hover with the help of 'elivateOnHover' and 'nameOnHover' prop. Even if elivateOnHover is true, the effect will only be there if the corresponding user has name specified in the data object.
<InlineImages
data={dataArray}
elivateOnHover={true}
nameOnHover={true}
/>
We can also control the distance between each user image with the help of spaceBetweenPics prop as follows.
<InlineImages
data={dataArray}
spaceBetweenPics={30}
/>
Props that can be passed to the component are listed below:
Prop | Description | Default |
---|---|---|
data: object[] | An array of user objects to specify the name and avatar url (image url) | undefined |
totalUserCount?: number | To specify the total number of users present if the additional count is to be displayed at the end of the image stack. The additional count displayed will be the difference between this value and length of data array | 0 |
elivateOnHover?: boolean | To add an elivation effect on hover action for user images | false |
nameOnHover?: boolean | To show the name of each user on hovering over the user image | false |
onUserClick?: function | A callback function to be triggered on image click | undefined |
spaceBetweenPics?: number | To specify the distance between each avatar (user image) | 20px |
All the default styles provided by this package are overridable using the styles
prop.
the below code shows all the overridable styles:
<InlineImages
data={dataArray}
styles={{
Avatar: () => ({...styles}),
Name: () => ({...styles}),
ExtraValue: () => ({...styles})
}}
/>
Avatar
- overrides the avatar (user image) styleName
- overrides the user name styleExtraValue
- overrides the style of additional value displayed at lastFAQs
A Multi Inline Images stack
The npm package @keyvaluesystems/react-multi-inline-images receives a total of 1 weekly downloads. As such, @keyvaluesystems/react-multi-inline-images popularity was classified as not popular.
We found that @keyvaluesystems/react-multi-inline-images demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.