@itwin/itwinui-react
Version:
A react component library for iTwinUI
37 lines (36 loc) • 1.3 kB
TypeScript
import * as React from 'react';
import { Tooltip } from '../Tooltip/Tooltip.js';
import type { ButtonProps } from './Button.js';
import type { PolymorphicForwardRefComponent } from '../../utils/index.js';
export type IconButtonProps = {
/**
* Button gets active style.
* @default false
*/
isActive?: boolean;
/**
* Name of the button, shown in a tooltip and exposed to assistive technologies.
*/
label?: React.ReactNode;
/**
* Props passed to the Tooltip that contains the `label`.
* Can be used for customizing the tooltip's `placement`, etc.
*/
labelProps?: Omit<React.ComponentPropsWithoutRef<typeof Tooltip>, 'content' | 'reference' | 'ariaStrategy' | 'children'>;
/**
* Passes props to IconButton icon.
*/
iconProps?: React.ComponentProps<'span'>;
/**
* @deprecated Use `label` instead.
*/
title?: string;
} & Omit<ButtonProps, 'startIcon' | 'endIcon' | 'startIconProps' | 'endIconProps' | 'labelProps' | 'loading' | 'stretched'>;
/**
* Icon button
* @example
* <IconButton label='Add'><SvgAdd /></IconButton>
* @example
* <IconButton label='Add' styleType='borderless'><SvgAdd /></IconButton>
*/
export declare const IconButton: PolymorphicForwardRefComponent<"button", IconButtonProps>;