UNPKG

1.89 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps, Breakpoint } from '@mui/system';
3import { Theme } from '../styles';
4import { OverridableComponent, OverrideProps } from '../OverridableComponent';
5import { ContainerClasses } from './containerClasses';
6
7export interface ContainerOwnProps {
8 children?: React.ReactNode;
9 /**
10 * Override or extend the styles applied to the component.
11 */
12 classes?: Partial<ContainerClasses>;
13 /**
14 * If `true`, the left and right padding is removed.
15 * @default false
16 */
17 disableGutters?: boolean;
18 /**
19 * Set the max-width to match the min-width of the current breakpoint.
20 * This is useful if you'd prefer to design for a fixed set of sizes
21 * instead of trying to accommodate a fully fluid viewport.
22 * It's fluid by default.
23 * @default false
24 */
25 fixed?: boolean;
26 /**
27 * Determine the max-width of the container.
28 * The container width grows with the size of the screen.
29 * Set to `false` to disable `maxWidth`.
30 * @default 'lg'
31 */
32 maxWidth?: Breakpoint | false;
33 /**
34 * The system prop that allows defining system overrides as well as additional CSS styles.
35 */
36 sx?: SxProps<Theme>;
37}
38
39export interface ContainerTypeMap<
40 AdditionalProps = {},
41 RootComponent extends React.ElementType = 'div',
42> {
43 props: AdditionalProps & ContainerOwnProps;
44 defaultComponent: RootComponent;
45}
46/**
47 *
48 * Demos:
49 *
50 * - [Container](https://mui.com/material-ui/react-container/)
51 *
52 * API:
53 *
54 * - [Container API](https://mui.com/material-ui/api/container/)
55 */
56declare const Container: OverridableComponent<ContainerTypeMap>;
57
58export type ContainerProps<
59 RootComponent extends React.ElementType = ContainerTypeMap['defaultComponent'],
60 AdditionalProps = {},
61> = OverrideProps<ContainerTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
62 component?: React.ElementType;
63};
64
65export default Container;