@base-ui-components/react
Version:
Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
36 lines • 1.27 kB
TypeScript
import * as React from 'react';
import { useAnchorPositioning, type Side, type Align } from "../../utils/useAnchorPositioning.js";
import type { BaseUIComponentProps } from "../../utils/types.js";
import type { ToastObject } from "../useToastManager.js";
/**
* Positions the toast against the anchor.
* Renders a `<div>` element.
*
* Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
*/
export declare const ToastPositioner: React.ForwardRefExoticComponent<ToastPositionerProps & React.RefAttributes<HTMLDivElement>>;
export interface ToastPositionerState {
side: Side;
align: Align;
anchorHidden: boolean;
}
export interface ToastPositionerProps extends BaseUIComponentProps<'div', ToastPositioner.State>, Omit<useAnchorPositioning.SharedParameters, 'side' | 'anchor'> {
/**
* An element to position the toast against.
*/
anchor?: Element | null;
/**
* Which side of the anchor element to align the toast against.
* May automatically change to avoid collisions.
* @default 'top'
*/
side?: Side;
/**
* The toast object associated with the positioner.
*/
toast: ToastObject<any>;
}
export declare namespace ToastPositioner {
type State = ToastPositionerState;
type Props = ToastPositionerProps;
}