@mui/x-tree-view
Version:
The community edition of the MUI X Tree View components.
49 lines • 2.27 kB
TypeScript
import * as React from 'react';
import { Theme } from '@mui/material/styles';
import { SxProps } from '@mui/system/styleFunctionSx';
import { SlotComponentProps } from '@mui/utils/types';
import { RichTreeViewClasses } from "./richTreeViewClasses.js";
import { RichTreeViewItemsSlotProps, RichTreeViewItemsSlots } from "../internals/components/RichTreeViewItems.js";
import { TreeViewSlotProps, TreeViewSlots } from "../internals/TreeViewProvider/TreeViewStyleContext.js";
import { RichTreeViewStore } from "../internals/RichTreeViewStore/index.js";
import { TreeViewValidItem } from "../models/items.js";
import { UseTreeViewStoreParameters } from "../internals/hooks/useTreeViewStore.js";
import { TreeViewPublicAPI } from "../internals/models/index.js";
export interface RichTreeViewSlots extends TreeViewSlots, RichTreeViewItemsSlots {
/**
* Element rendered at the root.
* @default RichTreeViewRoot
*/
root?: React.ElementType;
}
export interface RichTreeViewSlotProps<R extends {}, Multiple extends boolean | undefined> extends TreeViewSlotProps, RichTreeViewItemsSlotProps {
root?: SlotComponentProps<'ul', {}, RichTreeViewProps<R, Multiple>>;
}
export type RichTreeViewApiRef<R extends TreeViewValidItem<R> = any, Multiple extends boolean | undefined = any> = React.RefObject<Partial<TreeViewPublicAPI<RichTreeViewStore<R, Multiple>>> | undefined>;
export interface RichTreeViewPropsBase extends React.HTMLAttributes<HTMLUListElement> {
className?: string;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<RichTreeViewClasses>;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
}
export interface RichTreeViewProps<R extends {}, Multiple extends boolean | undefined> extends UseTreeViewStoreParameters<RichTreeViewStore<R, Multiple>>, RichTreeViewPropsBase {
/**
* Overridable component slots.
* @default {}
*/
slots?: RichTreeViewSlots;
/**
* The props used for each component slot.
* @default {}
*/
slotProps?: RichTreeViewSlotProps<R, Multiple>;
/**
* The ref object that allows Tree View manipulation. Can be instantiated with `useRichTreeViewApiRef()`.
*/
apiRef?: RichTreeViewApiRef;
}