A button component with a single icon that can be used to trigger actions.
import { ButtonIcon } from '@backstage/ui';
<ButtonIcon />
Prop | Type | Default | Responsive |
---|---|---|---|
variant | primarysecondary | primary | Yes |
size | smallmedium | medium | Yes |
icon | ReactNode | - | No |
isDisabled | boolean | false | No |
type | buttonsubmitreset | button | No |
className | string | - | No |
style | CSSProperties | - | No |
Here's a view when buttons have different variants.
<Flex align="center">
<ButtonIcon icon={<Icon name="cloud" />} variant="primary" />
<ButtonIcon icon={<Icon name="cloud" />} variant="secondary" />
</Flex>
Here's a view when buttons have different sizes.
<Flex align="center">
<ButtonIcon icon={<Icon name="cloud" />} size="small" />
<ButtonIcon icon={<Icon name="cloud" />} size="medium" />
</Flex>
Here's a view when buttons are disabled.
<ButtonIcon icon={<Icon name="cloud" />} isDisabled />
Here's a view when buttons are responsive.
<ButtonIcon icon={<Icon name="cloud" />} variant={{ initial: 'primary', lg: 'secondary' }} />
Our theming system is based on a mix between CSS classes, CSS variables and data attributes. If you want to customise this component, you can use one of these class names below.
bui-ButtonIcon
0.6.0
- Improve Button
, ButtonIcon
and ButtonLink
styling. #304480.6.0
- New tertiary
variant to Button
, ButtonIcon
and ButtonLink
. #304530.6.0
- Rename IconButton
to ButtonIcon
. #302970.6.0
- Remove the render
prop from all button-related components. #302970.5.0
- Button
, ButtonLink
, ButtonIcon
now default to size small
instead of medium
#30085, #300970.4.0
- Improve icon props on Button
and IconButton
#296670.2.0
- New IconButton
component #29239