import * as React from 'react'; import { Grid, Image, Button, Text, Label, gridBehavior, gridHorizontalBehavior } from '@fluentui/react-northstar'; import * as _ from 'lodash'; const imageNames = [ 'ade', 'chris', 'christian', 'daniel', 'elliot', 'helen', 'jenny', 'joe', 'justen', 'laura', 'matt', 'nan', 'nom', 'stevie', 'steve', 'tom', 'veronika', ]; const imageButtonStyles = { minWidth: '72px', maxWidth: '72px', height: '72px', padding: '0', margin: '0', background: '#fff', }; const getMSGridPositions = (msGridColumn, msGridRow) => ({ msGridColumn, msGridRow, } as React.CSSProperties); const renderImages = () => { return _.map(imageNames, (imageName, index) => ( )); }; const renderImageButtons = () => { return _.map(imageNames, (imageName, index) => ( )); }; const gridStyles = { gridColumnGap: '10px', gridRowGap: '10px', }; const GridExample = () => (
Grid with images, which are not natively focusable elements. Set to each item to make grid items focusable and navigable. Use to provide arrow key navigation in 4 directions. {renderImages()}
Grid with buttons images, which are natively focusable elements. No need to add{' '} {renderImageButtons()}
Grid with buttons images, which are natively focusable elements. Use to provide horizontal navigation within Grid with 4 arrow keys. {renderImageButtons()}
); export default GridExample;