@ui5/webcomponents-react
Version:
React Wrapper for UI5 Web Components and additional components
42 lines (41 loc) • 2.27 kB
TypeScript
import '@ui5/webcomponents/dist/Token.js';
import type { CommonProps, Ui5DomRef, UI5WCSlotsNode } from '@ui5/webcomponents-react-base';
interface TokenAttributes {
/**
* Defines whether the component is selected or not.
* @default false
*/
selected?: boolean;
/**
* Defines the text of the token.
* @default undefined
*/
text?: string | undefined;
}
interface TokenDomRef extends Required<TokenAttributes>, Ui5DomRef {
}
interface TokenPropTypes extends TokenAttributes, Omit<CommonProps, keyof TokenAttributes | 'closeIcon'> {
/**
* Defines the close icon for the token. If nothing is provided to this slot, the default close icon will be used.
* Accepts `Icon`.
*
* __Note:__ The content of the prop will be rendered into a [<slot>](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="closeIcon"`).
* 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<IIcon>`
*/
closeIcon?: UI5WCSlotsNode;
}
/**
* Tokens are small items of information (similar to tags) that mainly serve to visualize previously selected items.
*
*
*
* __Note:__ This is a UI5 Web Component! [Token UI5 Web Component Documentation](https://ui5.github.io/webcomponents/components/Token) | [Repository](https://github.com/UI5/webcomponents)
*/
declare const Token: import("react").ForwardRefExoticComponent<TokenPropTypes & import("@ui5/webcomponents-react-base").WithWebComponentPropTypes & import("react").RefAttributes<TokenDomRef>>;
export { Token };
export type { TokenDomRef, TokenPropTypes };