@etsoo/toolpad
Version:
Dashboard framework extention based on Toolpad Core
64 lines (63 loc) • 1.91 kB
TypeScript
import * as React from "react";
import { StackProps } from "@mui/material/Stack";
import { PageContainerToolbarProps } from "./PageContainerToolbar";
export interface PageContainerSlotProps {
toolbar: PageContainerToolbarProps;
}
export interface PageContainerSlots {
/**
* The component that renders the actions toolbar.
* @default Snackbar
*/
toolbar: React.ElementType;
}
export interface Breadcrumb {
/**
* The title of the breadcrumb segment.
*/
title: string;
/**
* The path the breadcrumb links to.
*/
path: string;
}
export type PageData = {
title?: string;
page?: string;
breadcrumbs?: Breadcrumb[] | ((source: Breadcrumb[]) => Breadcrumb[]);
pageHeader?: React.ReactNode;
};
type PageDataAction = PageData | true;
export declare const PageDataContext: React.Context<{
state: PageData;
dispatch: React.Dispatch<PageDataAction>;
}>;
export declare function PageDataContextProvider(props: React.PropsWithChildren<PageData>): import("react/jsx-runtime").JSX.Element;
type PageContainerBarProps = {
/**
* The components used for each slot inside.
*/
slots?: PageContainerSlots;
/**
* The props used for each slot inside.
*/
slotProps?: PageContainerSlotProps;
/**
* The component that renders the actions toolbar.
*/
titleBar?: false | ((title: string) => React.ReactNode);
};
export type PageContainerProps = React.PropsWithChildren<StackProps & PageContainerBarProps>;
/**
* A container component to provide a title and breadcrumbs for your pages.
*
* Demos:
*
* - [Page Container](https://mui.com/toolpad/core/react-page-container/)
*
* API:
*
* - [PageContainer API](https://mui.com/toolpad/core/api/page-container)
*/
declare function PageContainer(props: PageContainerProps): import("react/jsx-runtime").JSX.Element;
export { PageContainer };