shutterstock-ui-search-widget-js
v2.0.6
Published
Shutterstock Widget JavaScript Library
Downloads
4
Readme
szhutterstock-ui-search-widget
Shutterstock UI Search Widget JavaScript Library
Version 2.0.6
This is a robust and easy-to-integrate JavaScript widget for Shutterstock.
Installation and Usage
npm install shutterstock-widget
import ShutterstockWidget from "@ShutterstockWidget"
Example on window load:
const searchPage = {
name: 'searchPage',
component: ShutterstockWidget.components.SearchPage,
props: {
mediaType: 'images',
title: 'Shutterstock UI Search Widget',
subtitle: '',
dynamicTitle: true,
dynamicSubtitle: true,
showMore: true,
showSearchBar: true,
onItemClick: (e, item) => {
e.preventDefault();
console.log(item);
}
}
};
const widget = new ShutterstockWidget({
container: document.getElementById('widget-container'),
key: 'YOURKEY',
pages: [searchPage]
});
widget.getPage('searchPage').search()