Skip to content

Commit

Permalink
Add a simple example on how to customize preview chips with the grid …
Browse files Browse the repository at this point in the history
…system
  • Loading branch information
anthonyraymond committed Jun 11, 2020
1 parent ba2a5a9 commit fedb150
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/components/DropzoneArea.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,30 @@ const handlePreviewIcon = (fileObject, classes) => {
getPreviewIcon={handlePreviewIcon}
/>
```
### Using chips for preview

Chips use the Grid system as well, so you can customize the way they appears and benefit from the Material-UI grid customizations

```jsx
import * as React from 'react';
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles';

const useStyles = makeStyles((theme: Theme) => createStyles({
previewChip: {
minWidth: 160,
maxWidth: 210
}
}),
)

const classes = useStyles()

<DropzoneArea
showPreviews={true}
showPreviewsInDropzone={false}
useChipsForPreview
previewGridProps={{container: { spacing: 1, direction: 'row' }}}
previewChipProps={{classes: { root: classes.previewChip } }}
previewText="Selected files"
/>
```

0 comments on commit fedb150

Please sign in to comment.