@Tag(value="iron-icon") @NpmPackage(value="@vaadin/vaadin-icons", version="4.3.2") @JsModule(value="@vaadin/vaadin-icons/vaadin-icons.js") public class Icon extends Component implements HasStyle, ClickNotifier<Icon>
VaadinIcon
,
Serialized FormConstructor and Description |
---|
Icon()
Creates an Icon component that displays a Vaadin logo.
|
Icon(String icon)
Creates an Icon component that displays the given icon from vaadin-icons
collection.
|
Icon(String collection,
String icon)
Deprecated.
Use either
Icon(String) or
IronIcon(String,String) |
Icon(VaadinIcon icon)
Creates an Icon component that displays the given icon from
VaadinIcon . |
Modifier and Type | Method and Description |
---|---|
String |
getColor()
Gets the fill color of this icon as a String.
|
void |
setColor(String color)
Sets the fill color of the icon.
|
void |
setSize(String size)
Sets the width and the height of the icon.
|
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
getElement
addClickListener, addClickShortcut
addAttachListener
addDetachListener
public Icon()
public Icon(VaadinIcon icon)
VaadinIcon
.icon
- the icon to displaypublic Icon(String icon)
icon
- the icon name@Deprecated public Icon(String collection, String icon)
Icon(String)
or
IronIcon(String,String)
icon
from the
given collection
.collection
- the icon collectionicon
- the icon namepublic void setSize(String size)
The size should be in a format understood by the browser, e.g. "100px" or "2.5em".
size
- the size to set, may be null
to clear the valuepublic void setColor(String color)
The color should be in a format understood by the browser, e.g. "orange", "#FF9E2C" or "rgb(255, 158, 44)".
color
- the fill color to set, may be null
to clear the
valuepublic String getColor()
null
if the color has
not been setCopyright © 2025. All rights reserved.