---
title: "actionIcon(for:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebextension/actionicon(for:)"
---

# actionIcon(for:)

Returns the default action icon for the specified size.

## Declaration

```swift
func actionIcon(for size: CGSize) -> UIImage?
```

```swift
func actionIcon(for size: CGSize) -> NSImage?
```

## Parameters

- `size`: The size to use when looking up the action icon.

## Return Value

Return Value The action icon, or nil if the icon was unable to be loaded.

## Discussion

Discussion This icon serves as a default and should be used to represent the extension in contexts like action sheets or toolbars prior to the extension being loaded into an extension context. Once the extension is loaded, use the action(for:) API to get the tab-specific icon. The returned image will be the best match for the specified size that is available in the extension’s action icon set. If no matching icon is available, the method will fall back to the extension’s icon.

## See Also

### Related Documentation

- [icon(for:)](webkit/wkwebextension/icon(for:).md)
