Icon Buttons

Icons buttons are simple, icon-only buttons that can be used for actions and in toolbars.

For a full list of available icons, refer to the icon page .

Default Primary Secondary Ghost
Primary Destructive Secondary Destructive Ghost Destructive
Small Medium Large

Use the disabled attribute to disable the icon button.

Primary Secondary Ghost
Primary Destructive Secondary Destructive Ghost Destructive

Use the href attribute to convert the button to a link.

Link

Event handlers for clicks and other user actions can be registered as you would on a standard button element (or the React equivalent ).

Default
import '@ods/components/web.icon-button';

Note: You only need to import a web component once in your code, as it registers itself globally when defined, allowing you to use it anywhere within your application without needing to re-import it each time you want to use the component.

Properties

Please note, both DOM properties and HTML attributes are shown in the table below. Unless otherwise specified, the property and attribute names are identical.

Property/AttributeReflectsTypeDefault
name
string | undefined
library
string | undefined
src
string | undefined
href
string | undefined
target
'_blank' | '_parent' | '_self' | '_top' | undefined
download
string | undefined
label
string''
disabled
booleanfalse
variant
'default' | 'primary' | 'secondary' | 'ghost' | 'primary-destructive' | 'secondary-destructive' | 'ghost-destructive' | 'application-bar''default'
size
'small' | 'medium' | 'large''medium'

Events

React EventDescriptionEvent Detail
ods-blurEmitted when the icon button loses focus.--
ods-focusEmitted when the icon button gains focus.--

Methods

NameDescriptionArguments
click()Simulates a click on the icon button.--
focus()Sets focus on the icon button.--
blur()Removes focus from the icon button.--

Parts

NameDescription
baseThe component's base wrapper.

Dependencies

This component automatically imports the following dependencies.

  • ods-icon

Search