@trail-ui/react
Version:
29 lines (26 loc) • 1.14 kB
TypeScript
import { ModalProviderProps } from '@react-aria/overlays';
import { Href } from '@react-types/shared';
import { I18nProviderProps } from 'react-aria';
interface TrailUIProviderProps extends Omit<ModalProviderProps, 'children'> {
children: React.ReactNode;
/**
* The locale to apply to the children.
* @default "en-US"
*/
locale?: I18nProviderProps['locale'];
/**
* Provides a client side router to all nested components such as
* Link, Menu, Tabs, Table, etc.
*/
navigate?: (path: string) => void;
/**
* Convert an `href` provided to a link component to a native `href`
* For example, a router might accept hrefs relative to a base path,
* or offer additional custom ways of specifying link destinations.
* The original href specified on the link is passed to the navigate function of the RouterProvider,
* and useHref is used to generate the full native href to put on the actual DOM element.
*/
useHref?: (href: Href) => string;
}
declare const TrailUIProvider: React.FC<TrailUIProviderProps>;
export { TrailUIProvider, TrailUIProviderProps };