React TileView - Overview
The TileView UI component contains a collection of tiles. Tiles can store much more information than ordinary buttons, that is why they are very popular in apps designed for touch devices.
The following code adds a primitive TileView to your page.
Code
- import React from 'react';
- import 'devextreme/dist/css/dx.fluent.blue.light.css';
- import { TileView } from 'devextreme-react/tile-view';
- const dataSource = [
- { text: 'Alabama' },
- { text: 'Alaska' },
- { text: 'Arizona' },
- // ...
- ];
- export default function App() {
- return (
- <TileView dataSource={dataSource}/>
- );
- }
Note that field names in these data source items are conventional. This provides a default tile appearance, which can be customized later.
By default, the UI component is oriented horizontally, but you can orient it vertically using the direction property.
Code
- import React from 'react';
- import 'devextreme/dist/css/dx.fluent.blue.light.css';
- import { TileView } from 'devextreme-react/tile-view';
- export default function App() {
- return (
- <TileView direction="vertical"/>
- );
- }