@vela-ui/react
Version:
Vela UI React components
36 lines (33 loc) • 1.35 kB
TypeScript
import * as React$1 from 'react';
type ProviderContextProps = {
/**
* Prefix for all VelaUI classes.
* @default undefined
*/
prefix?: string;
};
declare const ProviderContext: React$1.Provider<ProviderContextProps>;
declare const useProviderContext: () => ProviderContextProps;
interface VelaUIProviderProps extends ProviderContextProps {
children: React.ReactNode;
/**
* The locale to apply to the children.
* @default "en-US"
*/
locale?: string;
/**
* Provides a client side router to all nested components such as
* Link, Menu, Tabs, Table, etc.
*/
navigate?: (path: string, routerOptions: never | undefined) => 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: string) => string;
}
declare const VelaUIProvider: React.FC<VelaUIProviderProps>;
export { ProviderContext, type ProviderContextProps, VelaUIProvider, type VelaUIProviderProps, useProviderContext };