UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

46 lines (45 loc) 2.07 kB
import { MantineTransition } from './transitions'; export interface TransitionProps { /** If set, the element is kept in the DOM when hidden. React 19 `Activity` is used to preserve state while the element is not visible. */ keepMounted?: boolean; /** * Controls how the element is hidden when `keepMounted` is set: * `'activity'` – hidden with React 19 `Activity` component, * `'display-none'` – hidden with `display: none` styles * @default 'activity' */ keepMountedMode?: 'activity' | 'display-none'; /** Transition name or object */ transition?: MantineTransition; /** Transition duration in ms @default 250 */ duration?: number; /** Exit transition duration in ms @default 250 */ exitDuration?: number; /** Transition timing function @default theme.transitionTimingFunction */ timingFunction?: string; /** Determines whether component should be mounted to the DOM */ mounted: boolean; /** Render function with transition styles argument */ children: (styles: React.CSSProperties) => React.JSX.Element; /** Called when exit transition ends */ onExited?: () => void; /** Called when exit transition starts */ onExit?: () => void; /** Called when enter transition starts */ onEnter?: () => void; /** Called when enter transition ends */ onEntered?: () => void; /** Delay in ms before enter transition starts */ enterDelay?: number; /** Delay in ms before exit transition starts */ exitDelay?: number; } export type TransitionOverride = Partial<Omit<TransitionProps, 'mounted'>>; export declare function Transition({ keepMounted, keepMountedMode, transition, duration, exitDuration, mounted, children, timingFunction, onExit, onEntered, onEnter, onExited, enterDelay, exitDelay, }: TransitionProps): import("react/jsx-runtime").JSX.Element | null; export declare namespace Transition { var displayName: string; } export declare namespace Transition { type Props = TransitionProps; type Override = TransitionOverride; }