Merged
Conversation
Rename and move all classes from the template package to com.flowingcode.vaadin.addons.fctogglebutton: - SerializationTest now tests FCToggleButton - TemplateDemo → FCToggleButtonDemo (updated title and route) - TemplateDemoView → FCToggleButtonDemoView (route, GitHub link) - DemoView forwards to FCToggleButtonDemoView - AbstractViewTest and ViewIT moved to fctogglebutton.it package - ViewIT now queries fc-toggle-button instead of paper-input
Replace all template references with FC Toggle Button content: badges, description, features list, demo URL, getting started examples, and release notes link.
Add FCToggleButtonVariant.CONTRAST, applying --lumo-contrast-color to the switch track when checked, consistent with Vaadin Button's contrast variant behavior.
Add FCToggleButtonVariant.MEDIUM as an explicit variant matching the default size, allowing it to be set programmatically alongside other theme variants.
Replace TEMPLATE_ADDON placeholder with FC Toggle Button Add-On in bug-report.yml and feature-request.yml descriptions.
Split demo content into three focused tabs: - FCToggleButtonDemo: labels and icons combinations - FCToggleButtonVariantsDemo: all color, size, and state variants - FCToggleButtonEventsDemo: value change, aria-label, and tooltip
Add width transition to slider so the squeeze animation is smooth. Add explicit active-state rules for medium, small, and large variants to override specificity from their resting-state rules, ensuring the expansion is symmetric (left-only when checked, right-only when unchecked) for all sizes.
Label color change based on toggle state was always active. Add highlightLabel property (default false) to the web component and expose withHighlightLabel()/withoutHighlightLabel() fluent methods on FCToggleButton to control the behavior explicitly.
Add a "With label highlighting" section to FCToggleButtonDemo with two examples using withHighlightLabel(): one with labels only and one combining labels and icons.
Vaadin 25 uses Jakarta Servlet, so the javax.servlet:javax.servlet-api declared in the main dependencies won't be compatible when building with -Pv25.
Collaborator
Author
|
Collaborator
Author
|
paodb
requested changes
Apr 8, 2026
Collaborator
Author
Fixed |
javier-godoy
requested changes
Apr 15, 2026
javier-godoy
approved these changes
Apr 16, 2026
paodb
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ToggleButtoncomponent extendingAbstractSinglePropertyField<ToggleButton, Boolean>,implementing
HasSize,HasComponents,HasLabel,HasAriaLabel,HasTooltip, andHasThemeVariant<ToggleButtonVariant>ToggleButtonVariantenum with color variants (PRIMARY,SUCCESS,WARNING,ERROR,CONTRAST), size variants (SMALL,MEDIUM,LARGE), and touch variant (LONGSWIPE)fc-toggle-buttonLitElement web component with shadow DOM, Lumo tokenintegration, and symmetric active-state animations for all size variants
LONGSWIPEvariant producing a wider switch track optimized for touch; combinable withsize variants (
LONGSWIPE+SMALL/MEDIUM/LARGE)past the 50% threshold snaps to the new state with a smooth CSS transition
setLeftLabel,setRightLabel,setLeftIcon,setRightIcon,setItemLabelGenerator,withHighlightLabel,withoutHighlightLabel,withIconsInside,withIconsOutsideof the
SUCCESS,WARNING,ERROR, orCONTRASTvariant instead of always defaulting toprimary
withIconsInside()swaps the default layout to[label] [icon] [switch] [icon] [label],placing icons adjacent to the switch and labels on the outer edges
templatepackage tocom.flowingcode.vaadin.addons.togglebuttonpom.xmlname and description per AddonsInternal guidelinesREADME.mdwith correct badges, links, features list, and Getting Started examplesTest plan
mvn clean install— build passesmvn clean install jetty:runand verify all three demo tabs render correctlywithHighlightLabel()highlights the active side labeldisabledandread-onlystates behave correctlymvn test