com.github.fluorumlabs.disconnect.vaadin.Button Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of disconnect-vaadin Show documentation
Show all versions of disconnect-vaadin Show documentation
Vaadin components bindings for Disconnect Zero
The newest version!
package com.github.fluorumlabs.disconnect.vaadin;
import com.github.fluorumlabs.disconnect.core.annotations.WebComponent;
import com.github.fluorumlabs.disconnect.polymer.mixins.HasGestureEventListeners;
import com.github.fluorumlabs.disconnect.vaadin.elements.ButtonElement;
import com.github.fluorumlabs.disconnect.vaadin.mixins.HasControlStateMixin;
import com.github.fluorumlabs.disconnect.vaadin.mixins.HasElementMixin;
import com.github.fluorumlabs.disconnect.vaadin.mixins.HasThemableMixin;
import com.github.fluorumlabs.disconnect.vaadin.types.ThemeVariant;
import com.github.fluorumlabs.disconnect.zero.component.*;
import js.extras.JsEnum;
/**
* <vaadin-button>
is a Web Component providing an accessible and customizable button.
*
* <vaadin-button>
* </vaadin-button>
*
* document.querySelector('vaadin-button').addEventListener('click', () => alert
* ('Hello World!'));
*
* Styling
* The following shadow DOM parts are exposed for styling:
*
*
*
* Part name Description
*
*
* label
The label (text) inside the button
* prefix
A slot for e.g. an icon before the label
* suffix
A slot for e.g. an icon after the label
*
*
* The following attributes are exposed for styling:
*
*
*
* Attribute Description
*
*
* active
Set when the button is pressed down, either with mouse, touch or the keyboard
* .
* disabled
Set when the button is disabled.
* focus-ring
Set when the button is focused using the keyboard.
* focused
Set when the button is focused.
*
*
* See
* ThemableMixin – how to apply styles for shadow parts
*/
@WebComponent
public class Button extends AbstractComponent
implements HasElementMixin,
HasControlStateMixin,
HasThemableMixin,
HasGestureEventListeners,
HasSlots,
HasStyle, HasComponents> {
public Button() {
super(ButtonElement.TAGNAME());
}
public HasSlots.Container prefix() {
return slotted("prefix");
}
public HasSlots.Container suffix() {
return slotted("suffix");
}
public abstract static class Variant extends ThemeVariant {
public static final Variant SMALL = JsEnum.of("small");
public static final Variant LARGE = JsEnum.of("large");
public static final Variant TERTIARY = JsEnum.of("tertiary");
public static final Variant TERTIARY_INLINE = JsEnum.of("tertiary-inline");
public static final Variant PRIMARY = JsEnum.of("primary");
public static final Variant SUCCESS = JsEnum.of("success");
public static final Variant ERROR = JsEnum.of("error");
public static final Variant CONTRAST = JsEnum.of("contrast");
public static final Variant ICON = JsEnum.of("icon");
}
}