UNPKG

1.48 kBTypeScriptView Raw
1import * as React from 'react';
2import { OverridableComponent, OverrideProps } from '../OverridableComponent';
3
4export interface ContainerTypeMap<P = {}, D extends React.ElementType = 'div'> {
5 props: P & {
6 children: NonNullable<React.ReactNode>;
7 /**
8 * If `true`, the left and right padding is removed.
9 */
10 disableGutters?: boolean;
11 /**
12 * Set the max-width to match the min-width of the current breakpoint.
13 * This is useful if you'd prefer to design for a fixed set of sizes
14 * instead of trying to accommodate a fully fluid viewport.
15 * It's fluid by default.
16 */
17 fixed?: boolean;
18 /**
19 * Determine the max-width of the container.
20 * The container width grows with the size of the screen.
21 * Set to `false` to disable `maxWidth`.
22 */
23 maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false;
24 };
25 defaultComponent: D;
26 classKey: ContainerClassKey;
27}
28/**
29 *
30 * Demos:
31 *
32 * - [Container](https://mui.com/components/container/)
33 *
34 * API:
35 *
36 * - [Container API](https://mui.com/api/container/)
37 */
38declare const Container: OverridableComponent<ContainerTypeMap>;
39
40export type ContainerClassKey =
41 | 'root'
42 | 'disableGutters'
43 | 'fixed'
44 | 'maxWidthXs'
45 | 'maxWidthSm'
46 | 'maxWidthMd'
47 | 'maxWidthLg'
48 | 'maxWidthXl';
49
50export type ContainerProps<
51 D extends React.ElementType = ContainerTypeMap['defaultComponent'],
52 P = {}
53> = OverrideProps<ContainerTypeMap<P, D>, D>;
54
55export default Container;