UNPKG

1.56 kBTypeScriptView Raw
1import * as React from 'react';
2import { NavSelectClickHandler } from './Nav';
3import { OUIAProps } from '../../helpers';
4export interface NavItemProps extends Omit<React.HTMLProps<HTMLAnchorElement>, 'onClick'>, OUIAProps {
5 /** Content rendered inside the nav item. */
6 children?: React.ReactNode;
7 /** Whether to set className on children when React.isValidElement(children) */
8 styleChildren?: boolean;
9 /** Additional classes added to the nav item */
10 className?: string;
11 /** Target navigation link */
12 to?: string;
13 /** Flag indicating whether the item is active */
14 isActive?: boolean;
15 /** Group identifier, will be returned with the onToggle and onSelect callback passed to the Nav component */
16 groupId?: string | number | null;
17 /** Item identifier, will be returned with the onToggle and onSelect callback passed to the Nav component */
18 itemId?: string | number | null;
19 /** If true prevents the default anchor link action to occur. Set to true if you want to handle navigation yourself. */
20 preventDefault?: boolean;
21 /** Callback for item click */
22 onClick?: NavSelectClickHandler;
23 /** Component used to render NavItems if React.isValidElement(children) is false */
24 component?: React.ReactNode;
25 /** Flyout of a nav item. This should be a Menu component. */
26 flyout?: React.ReactElement;
27 /** Callback when flyout is opened or closed */
28 onShowFlyout?: () => void;
29}
30export declare const NavItem: React.FunctionComponent<NavItemProps>;
31//# sourceMappingURL=NavItem.d.ts.map
\No newline at end of file