UNPKG

1.78 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 { ToolbarClasses } from './toolbarClasses';
7
8export interface ToolbarPropsVariantOverrides {}
9
10export interface ToolbarOwnProps {
11 /**
12 * The Toolbar children, usually a mixture of `IconButton`, `Button` and `Typography`.
13 * The Toolbar is a flex container, allowing flex item properties to be used to lay out the children.
14 */
15 children?: React.ReactNode;
16 /**
17 * Override or extend the styles applied to the component.
18 */
19 classes?: Partial<ToolbarClasses>;
20 /**
21 * If `true`, disables gutter padding.
22 * @default false
23 */
24 disableGutters?: boolean;
25 /**
26 * The variant to use.
27 * @default 'regular'
28 */
29 variant?: OverridableStringUnion<'regular' | 'dense', ToolbarPropsVariantOverrides>;
30 /**
31 * The system prop that allows defining system overrides as well as additional CSS styles.
32 */
33 sx?: SxProps<Theme>;
34}
35
36export interface ToolbarTypeMap<
37 AdditionalProps = {},
38 RootComponent extends React.ElementType = 'div',
39> {
40 props: AdditionalProps & ToolbarOwnProps;
41 defaultComponent: RootComponent;
42}
43/**
44 *
45 * Demos:
46 *
47 * - [App Bar](https://mui.com/material-ui/react-app-bar/)
48 *
49 * API:
50 *
51 * - [Toolbar API](https://mui.com/material-ui/api/toolbar/)
52 */
53declare const Toolbar: OverridableComponent<ToolbarTypeMap>;
54
55export type ToolbarProps<
56 RootComponent extends React.ElementType = ToolbarTypeMap['defaultComponent'],
57 AdditionalProps = {},
58> = OverrideProps<ToolbarTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
59 component?: React.ElementType;
60};
61
62export default Toolbar;