UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

73 lines (72 loc) 3.65 kB
import '@ui5/webcomponents/dist/Card.js'; import type { CommonProps, Ui5DomRef, UI5WCSlotsNode } from '@ui5/webcomponents-react-base'; import type { ReactNode } from 'react'; interface CardAttributes { /** * Defines the accessible name of the component, which is used as the name of the card region and should be unique per card. * * **Note:** `accessibleName` should be always set, unless `accessibleNameRef` is set. * @default undefined */ accessibleName?: string | undefined; /** * Defines the IDs of the elements that label the component. * @default undefined */ accessibleNameRef?: string | undefined; /** * Defines if a loading indicator would be displayed over the card. * * **Note:** Available since [v2.1.0](https://github.com/UI5/webcomponents/releases/tag/v2.1.0) of **@ui5/webcomponents**. * @default false */ loading?: boolean; /** * Defines the delay in milliseconds, after which the loading indicator will show up for this card. * * **Note:** Available since [v2.1.0](https://github.com/UI5/webcomponents/releases/tag/v2.1.0) of **@ui5/webcomponents**. * @default 1000 */ loadingDelay?: number; } interface CardDomRef extends Required<CardAttributes>, Ui5DomRef { } interface CardPropTypes extends CardAttributes, Omit<CommonProps, keyof CardAttributes | 'children' | 'header'> { /** * Defines the content of the component. * * __Supported Node Type/s:__ `Array<HTMLElement>` */ children?: ReactNode | ReactNode[]; /** * Defines the header of the component. * * **Note:** Use `CardHeader` for the intended design. * * __Note:__ The content of the prop will be rendered into a [&lt;slot&gt;](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) by assigning the respective [slot](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/slot) attribute (`slot="header"`). * Since you can't change the DOM order of slots when declaring them within a prop, it might prove beneficial to manually mount them as part of the component's children, especially when facing problems with the reading order of screen readers. * * __Note:__ When passing a custom React component to this prop, you have to make sure your component reads the `slot` prop and appends it to the most outer element of your component. * Learn more about it [here](https://ui5.github.io/webcomponents-react/v2/?path=/docs/knowledge-base-handling-slots--docs). * * __Supported Node Type/s:__ `Array<CardHeader>` */ header?: UI5WCSlotsNode; } /** * The `Card` is a component that represents information in the form of a * tile with separate header and content areas. * The content area of a `Card` can be arbitrary HTML content. * The header can be used through slot `header`. For which there is a `CardHeader` component to achieve the card look and feel. * * Note: We recommend the usage of `CardHeader` for the header slot, so advantage can be taken for keyboard handling, styling and accessibility. * * * * `import "@ui5/webcomponents/dist/CardHeader.js";` (for `CardHeader`) * * __Note:__ This is a UI5 Web Component! [Card UI5 Web Component Documentation](https://ui5.github.io/webcomponents/components/Card) | [Repository](https://github.com/UI5/webcomponents) */ declare const Card: import("react").ForwardRefExoticComponent<CardPropTypes & import("@ui5/webcomponents-react-base").WithWebComponentPropTypes & import("react").RefAttributes<CardDomRef>>; export { Card }; export type { CardDomRef, CardPropTypes };