Installation
Section titled “Installation”- Package
@bigbang/ui- Import
import { IconButton } from '@bigbang/ui';- Source
- IconButton.tsx
- Storybook
- IconButton · Playground
IconButton is in the @bigbang/ui package. Icons are picked by name from the @bigbang/icons registry.
import { IconButton } from '@bigbang/ui';
<IconButton icon="x" label="Close" onClick={close} />;<IconButton variant="secondary" tone="danger" icon="trash" label="Delete" />;iconRequired- Description
- Registered icon name. The icon is decorative;
labelnames the button. - Type
IconName
labelRequired- Description
- The accessible name, read by screen readers and used as the tooltip text. Required: an icon alone does not say what the button does. Write a verb phrase ("Kapat", "Close").
- Type
string
variant- Description
- How important the action is.
tertiaryhas no fill or border and suits toolbars and table rows.glasssuits controls over a photo or video; inside a darkdata-backdropit takes the clearer glass. - Type
'glass' | 'primary' | 'secondary' | 'tertiary' | 'glass-prominent'- Default
'tertiary'
tone- Description
dangermarks an action that deletes or cannot be undone.- Type
'neutral' | 'danger'- Default
'neutral'
size- Description
- Square box of 24, 32, 36 or 40 px, matching the Button heights.
xsis for in-cell actions in dense tables. - Type
'xs' | 'sm' | 'md' | 'lg'- Default
'md'
shape- Description
circleis fully round, for floating or avatar-like actions.- Type
'square' | 'circle'- Default
'square'
loading- Description
- Shows a spinner over the icon and ignores clicks while the action runs; the button stays focusable.
- Type
boolean- Default
false
loadingLabel- Description
- Text announced once when
loadingstarts. Defaults toui.button.loading("Yükleniyor" or "Loading"). - Type
string
disabled- Description
- Turns off interaction and removes the button from the tab order.
- Type
boolean- Default
false
focusableWhenDisabled- Description
- Keeps the button focusable while disabled, with
aria-disabled. Use it when nearby text explains why. - Type
boolean- Default
false
tooltip- Description
- Shows
labelin a Tooltip on hover and keyboard focus, so sighted users can read the name too. - Type
boolean- Default
true
tooltipSide- Description
- Side of the button where the tooltip appears.
- Type
'top' | 'bottom' | 'inline-start' | 'inline-end'- Default
'top'
className- Description
- For layout only: margins and placement.
- Type
string
Other Base UI Button attributes such as onClick, type, name and form pass through to the button.
Data attributes
Section titled “Data attributes”data-component="icon-button": on the root<button>.data-loadinganddata-disabled: in the matching state, from Button.