All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.fluorumlabs.disconnect.vaadin.Button Maven / Gradle / Ivy

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 nameDescription
labelThe label (text) inside the button
prefixA slot for e.g. an icon before the label
suffixA slot for e.g. an icon after the label
* The following attributes are exposed for styling: * * * * * * * * * * * *
AttributeDescription
activeSet when the button is pressed down, either with mouse, touch or the keyboard * .
disabledSet when the button is disabled.
focus-ringSet when the button is focused using the keyboard.
focusedSet 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"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy