DevExtreme React - Overview

The Gallery is a widget that displays a collection of images in a carousel. The widget is supplied with various navigation controls that allow a user to switch between images.

View Demo

The following code adds the Gallery widget to your page. The simplest configuration of the widget requires only a dataSource and height to be specified.

  • import React from 'react';
  • import 'devextreme/dist/css/dx.common.css';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import { Gallery } from 'devextreme-react/gallery';
  •  
  • const dataSource = [
  • 'https://js.devexpress.com/Content/images/doc/19_2/PhoneJS/person1.png',
  • 'https://js.devexpress.com/Content/images/doc/19_2/PhoneJS/person2.png',
  • 'https://js.devexpress.com/Content/images/doc/19_2/PhoneJS/person3.png',
  • 'https://js.devexpress.com/Content/images/doc/19_2/PhoneJS/person4.png'
  • ];
  •  
  • class App extends React.Component {
  • render() {
  • return (
  • <Gallery
  • dataSource={dataSource}
  • height={300}
  • />
  • );
  • }
  • }
  •  
  • export default App;
See Also