UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

57 lines 2.64 kB
import type { To } from 'history'; import React from 'react'; export type BreadcrumbsProps = React.PropsWithChildren<{ /** * Optional class name for the breadcrumbs container. */ className?: string; /** * Controls the overflow behavior of the breadcrumbs. * By default all overflowing crumbs will "wrap" in the given space taking up extra height. * In the "menu" option we'll see the overflowing crumbs as part of a menu like dropdown instead of the root breadcrumb. * In "menu-with-root" we see that instead of the root, the menu button will take the place of the next breadcrumb. */ overflow?: 'wrap' | 'menu' | 'menu-with-root'; /** * Controls the visual variant of the breadcrumbs. * By default, the breadcrumbs will have a normal appearance. * In the "spacious" option, the breadcrumbs will have increased padding and a more relaxed layout. */ variant?: 'normal' | 'spacious'; /** * Allows passing of CSS custom properties to the breadcrumbs container. */ style?: React.CSSProperties; }>; declare function Breadcrumbs({ className, children, style, overflow, variant }: BreadcrumbsProps): React.JSX.Element; declare namespace Breadcrumbs { var displayName: string; } type DistributiveOmit<T, TOmitted extends PropertyKey> = T extends any ? Omit<T, TOmitted> : never; type StyledBreadcrumbsItemProps<As extends React.ElementType> = { as?: As; to?: To; selected?: boolean; className?: string; style?: React.CSSProperties; } & DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? 'a' : As>, 'as'>; export type BreadcrumbsItemProps<As extends React.ElementType = 'a'> = StyledBreadcrumbsItemProps<As>; declare const _default: typeof Breadcrumbs & { Item: React.ForwardRefExoticComponent<Omit<StyledBreadcrumbsItemProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<any>>; }; export default _default; /** * @deprecated Use the `Breadcrumbs` component instead (i.e. `<Breadcrumb>` → `<Breadcrumbs>`) */ export declare const Breadcrumb: typeof Breadcrumbs & { Item: React.ForwardRefExoticComponent<Omit<StyledBreadcrumbsItemProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<any>>; }; /** * @deprecated Use the `BreadcrumbsProps` type instead */ export type BreadcrumbProps = BreadcrumbsProps; /** * @deprecated Use the `BreadcrumbsItemProps` type instead */ export type BreadcrumbItemProps<As extends React.ElementType = 'a'> = BreadcrumbsItemProps<As>; //# sourceMappingURL=Breadcrumbs.d.ts.map