@itwin/itwinui-react
Version:
A react component library for iTwinUI
37 lines (36 loc) • 1.13 kB
TypeScript
import * as React from 'react';
import type { PolymorphicForwardRefComponent } from '../../utils/index.js';
import { Icon } from '../Icon/Icon.js';
type StatusMessageProps = {
/**
* Custom icon to be displayed at the beginning.
*
* - It will default to the `status` icon, if `status` is set.
* - If `startIcon` is set to `null`, no icon will be displayed, even if `status` is set.
*/
startIcon?: React.JSX.Element | null;
/**
* Message content.
*/
children: React.ReactNode;
/**
* Status of the message.
*/
status?: 'positive' | 'warning' | 'negative';
/**
* Passes props to icon
*/
iconProps?: React.ComponentProps<typeof Icon>;
/**
* Passes props to content
*/
contentProps?: React.ComponentPropsWithRef<'div'>;
};
/**
* Component to display icon and text below the form field.
* @example
* <StatusMessage>This is the text</StatusMessage>
* <StatusMessage startIcon={<SvgStar />}>This is the text</StatusMessage>
*/
export declare const StatusMessage: PolymorphicForwardRefComponent<"div", StatusMessageProps>;
export {};