UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

81 lines (80 loc) 4.06 kB
import '@ui5/webcomponents/dist/Breadcrumbs.js'; import type { BreadcrumbsItemClickEventDetail } from '@ui5/webcomponents/dist/Breadcrumbs.js'; import type BreadcrumbsDesign from '@ui5/webcomponents/dist/types/BreadcrumbsDesign.js'; import type BreadcrumbsSeparator from '@ui5/webcomponents/dist/types/BreadcrumbsSeparator.js'; import type { CommonProps, Ui5CustomEvent, Ui5DomRef } from '@ui5/webcomponents-react-base'; import type { ReactNode } from 'react'; interface BreadcrumbsAttributes { /** * Defines the accessible name of the component. * * **Note:** Available since [v2.24.0](https://github.com/UI5/webcomponents/releases/tag/v2.24.0) of **@ui5/webcomponents**. * @default undefined */ accessibleName?: string | undefined; /** * Defines the visual appearance of the last BreadcrumbsItem. * * The Breadcrumbs supports two visual appearances for the last BreadcrumbsItem: * - "Standard" - displaying the last item as "current page" (bold and without separator) * - "NoCurrentPage" - displaying the last item as a regular BreadcrumbsItem, followed by separator * @default "Standard" */ design?: BreadcrumbsDesign | keyof typeof BreadcrumbsDesign; /** * Determines the visual style of the separator between the breadcrumb items. * @default "Slash" */ separators?: BreadcrumbsSeparator | keyof typeof BreadcrumbsSeparator; } interface BreadcrumbsDomRef extends Required<BreadcrumbsAttributes>, Ui5DomRef { } interface BreadcrumbsPropTypes extends BreadcrumbsAttributes, Omit<CommonProps, keyof BreadcrumbsAttributes | 'children' | 'onItemClick'> { /** * Defines the component items. * * **Note:** Use the `BreadcrumbsItem` component to define the desired items. * * __Supported Node Type/s:__ `Array<BreadcrumbsItem>` */ children?: ReactNode | ReactNode[]; /** * Fires when a `BreadcrumbsItem` is clicked. * * **Note:** You can prevent browser location change by calling `event.preventDefault()`. * * **Note:** Call `event.preventDefault()` inside the handler of this event to prevent its default action/s. * * | cancelable | bubbles | * | :--------: | :-----: | * | ✅|✅| */ onItemClick?: (event: Ui5CustomEvent<BreadcrumbsDomRef, BreadcrumbsItemClickEventDetail>) => void; } /** * Enables users to navigate between items by providing a list of links to previous steps in the user's navigation path. * It helps the user to be aware of their location within the application and allows faster navigation. * * The last three steps can be accessed as links directly, while the remaining links prior to them are available * in a drop-down menu. * * You can choose the type of separator to be used from a number of predefined options. * * ### Keyboard Handling * The `Breadcrumbs` provides advanced keyboard handling. * * - [F4], [Alt] + [Up], [Alt] + [Down], [Space], or [Enter] - If the dropdown arrow is focused - opens/closes the drop-down. * - [Space],[Enter] - Activates the focused item and triggers the `item-click` event. * - [Escape] - Closes the drop-down. * - [Left] - If the drop-down is closed - navigates one item to the left. * - [Right] - If the drop-down is closed - navigates one item to the right. * - [Up] - If the drop-down is open - moves focus to the next item. * - [Down] - If the drop-down is open - moves focus to the previous item. * - [Home] - Navigates to the first item. * - [End] - Navigates to the last item. * * __Note:__ This is a UI5 Web Component! [Breadcrumbs UI5 Web Component Documentation](https://ui5.github.io/webcomponents/components/Breadcrumbs) | [Repository](https://github.com/UI5/webcomponents) */ declare const Breadcrumbs: import("react").ForwardRefExoticComponent<BreadcrumbsPropTypes & import("@ui5/webcomponents-react-base").WithWebComponentPropTypes & import("react").RefAttributes<BreadcrumbsDomRef>>; export { Breadcrumbs }; export type { BreadcrumbsDomRef, BreadcrumbsPropTypes };