@primer/react
Version:
An implementation of GitHub's Primer Design System using React
47 lines (46 loc) • 1.32 kB
TypeScript
import { IconProps } from "@primer/octicons-react";
//#region src/UnderlineNav/UnderlineNavItemsRegistry.d.ts
type LinkProps = {
download?: string;
href?: string;
hrefLang?: string;
media?: string;
ping?: string;
rel?: string;
target?: string;
type?: string;
referrerPolicy?: React.AnchorHTMLAttributes<HTMLAnchorElement>['referrerPolicy'];
};
type UnderlineNavItemProps = {
/**
* Primary content for an UnderlineNav
*/
children?: React.ReactNode;
/**
* Callback that will trigger both on click selection and keyboard selection.
*/
onSelect?: (event: React.MouseEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLAnchorElement>) => void;
/**
* Is `UnderlineNav.Item` current page?
*/
'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false' | boolean;
/**
* Icon before the text
* @deprecated Use the `leadingVisual` prop instead
*/
icon?: React.FunctionComponent<IconProps> | React.ReactElement<any>;
/**
* Render a visual before the text
*/
leadingVisual?: React.ReactElement;
/**
* Renders `UnderlineNav.Item` as given component i.e. react-router's Link
**/
as?: React.ElementType | 'a';
/**
* Counter
*/
counter?: number | string;
} & LinkProps;
//#endregion
export { UnderlineNavItemProps };