UNPKG

1.88 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { OverridableStringUnion } from '@mui/types';
4import { Theme } from '..';
5import { OverridableComponent, OverrideProps } from '../OverridableComponent';
6import { ImageListClasses } from './imageListClasses';
7
8export interface ImageListPropsVariantOverrides {}
9
10export interface ImageListOwnProps {
11 /**
12 * The content of the component, normally `ImageListItem`s.
13 */
14 children: NonNullable<React.ReactNode>;
15 /**
16 * Override or extend the styles applied to the component.
17 */
18 classes?: Partial<ImageListClasses>;
19 /**
20 * Number of columns.
21 * @default 2
22 */
23 cols?: number;
24 /**
25 * The gap between items in px.
26 * @default 4
27 */
28 gap?: number;
29 /**
30 * The height of one row in px.
31 * @default 'auto'
32 */
33 rowHeight?: number | 'auto';
34 /**
35 * The system prop that allows defining system overrides as well as additional CSS styles.
36 */
37 sx?: SxProps<Theme>;
38 /**
39 * The variant to use.
40 * @default 'standard'
41 */
42 variant?: OverridableStringUnion<
43 'masonry' | 'quilted' | 'standard' | 'woven',
44 ImageListPropsVariantOverrides
45 >;
46}
47
48export interface ImageListTypeMap<
49 AdditionalProps = {},
50 RootComponent extends React.ElementType = 'ul',
51> {
52 props: AdditionalProps & ImageListOwnProps;
53 defaultComponent: RootComponent;
54}
55/**
56 *
57 * Demos:
58 *
59 * - [Image List](https://mui.com/material-ui/react-image-list/)
60 *
61 * API:
62 *
63 * - [ImageList API](https://mui.com/material-ui/api/image-list/)
64 */
65declare const ImageList: OverridableComponent<ImageListTypeMap>;
66
67export type ImageListProps<
68 RootComponent extends React.ElementType = ImageListTypeMap['defaultComponent'],
69 AdditionalProps = {},
70> = OverrideProps<ImageListTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
71 component?: React.ElementType;
72};
73
74export default ImageList;