@iobroker/adapter-react-v5
Version:
React components to develop ioBroker interfaces with react.
38 lines (37 loc) • 1.39 kB
TypeScript
import React from 'react';
interface InfoBoxProps {
/** Text to display in the info box */
children: string | (string | React.JSX.Element | null)[] | React.JSX.Element;
/** The type determines the color and symbol */
type: 'warning' | 'info' | 'error' | 'ok';
/** If the Box is closeable */
closeable?: boolean;
/** Use together with `closeable: true`. You can specify in which variable in local storage the state of this info box could be stored */
storeId?: string;
/** Use together with `closeable: true`, listener called if close button clicked */
onClose?: (desiredState: boolean) => void;
/** Custom style */
style?: React.CSSProperties;
/** Icon position */
iconPosition?: 'top' | 'middle';
/** Use together with `closeable: true`. If the box is closed or not. In this case, it will be controlled from outside */
closed?: boolean;
}
interface InfoBoxState {
closed: boolean;
}
/**
* This component can be used to show important information or warnings to the user
*/
export declare class InfoBox extends React.Component<InfoBoxProps, InfoBoxState> {
private readonly refTypo;
private height;
private width;
constructor(props: InfoBoxProps);
componentDidMount(): void;
onClick(): void;
detectHeight(): void;
componentDidUpdate(): void;
render(): React.ReactNode;
}
export {};