UNPKG

@sinchsmb/ui-kit

Version:

UI kit for SinchSMB frontend

28 lines (27 loc) 979 B
import { ReactElement } from 'react'; import { CommonProps } from '../../types'; import { ButtonProps } from '../Button/Button'; import { IconGlyph } from '../Icon/constants'; /** Props for {@link FieldSuffixIconButton} */ export interface FieldSuffixIconButtonProps extends CommonProps, Pick<ButtonProps, 'onClick' | 'onMouseDown'> { /** icon that should be displayed */ icon: IconGlyph | ReactElement; /** Description of button for a11y */ ariaLabel: string; } /** * An icon button that can be added as a suffix to fields that have the property `suffix` * * ```tsx * <TextField * suffix={<FieldSuffixIconButton ariaLabel="Clear" icon={IconGlyph.CloseCircle} onClick={handleClick} />} * /> * ``` * * ```tsx * <NumberField * suffix={<FieldSuffixIconButton ariaLabel="Clear" icon={IconGlyph.CloseCircle} onClick={handleClick} />} * /> * ``` */ export declare function FieldSuffixIconButton(props: FieldSuffixIconButtonProps): JSX.Element | null;