Directory

← Back

ToggleButton for Flow

Web Component providing an on/off switch that users can toggle

Author

Rating

Popularity

2100+

Usage

Toggle button provides an on/off switch that user can toggle by tapping the switch.

Client-side implementation

From 3.0.0

The client-side is a standard checkbox with a custom css file.

Before 3.0.0

This is the server-side (Java) API for Vaadin Platform for the vcf-toggle-button component. Looking for the client-side version? It can be found here: https://vaadin.com/directory/component/vaadin-component-factoryvcf-toggle-button

License & Author

This Add-on is distributed under Apache 2.0

Component Factory Toggle Button is written by Vaadin Ltd.

Major pieces of development of this add-on has been sponsored by multiple customers of Vaadin. Read more about Expert on Demand at: Support and Pricing

Sample code

ToggleButton toggle = new ToggleButton();
toggle.setLabel("Label");
ToggleButton disabledToggle = new ToggleButton("Disabled");
disabledToggle.setEnabled(false);
ToggleButton toggle = new ToggleButton("Toggle");
Div message = new Div();
toggle.addValueChangeListener(evt -> message.setText(
        String.format("Toggle button value changed from '%s' to '%s'",
                evt.getOldValue(), evt.getValue())));

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Version compatible with Vaadin 23 and Vaadin 24. The webcomponent vcf-toggle-button has been removed and replaced by a vaadin-checkbox with a theme toggle-button. It might create some breaking changes. It also gives more functionalities coming from the Checkbox like a Tooltip.

Released
2023-04-04
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 23
Vaadin 24
Vaadin 14 in 1.0.2
Browser
Browser Independent

Vaadin Add-on Directory

Find open-source widgets, add-ons, themes, and integrations for your Vaadin application. Vaadin Add-on Directory
The channel for finding, promoting, and distributing Vaadin add-ons.
Online