Skip to content

Commit 8bc2ac2

Browse files
docs(readme): update README with highlight label feature and version
1 parent 820af40 commit 8bc2ac2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ A toggle button component for Vaadin Flow that supports customizable labels and
1313
* Toggle between two states with a single click
1414
* Customizable left and right labels
1515
* Support for icons on both sides via slots
16+
* Optional label highlighting: active-side label uses the primary color, inactive side is dimmed
1617
* Theme variants: `SMALL`, `MEDIUM`, `LARGE`, `PRIMARY`, `SUCCESS`, `WARNING`, `ERROR`, `CONTRAST`
1718
* Fluent API for easy configuration
1819
* Full integration with Vaadin's `HasValue`, `HasSize`, `HasAriaLabel`, and `HasTooltip`
@@ -33,7 +34,7 @@ Add the following dependencies in your pom.xml file:
3334
<dependency>
3435
<groupId>com.flowingcode.vaadin.addons</groupId>
3536
<artifactId>fc-toggle-button-addon</artifactId>
36-
<version>X.Y.Z</version>
37+
<version>1.0.0</version>
3738
</dependency>
3839
```
3940
<!-- the above dependency should be updated with latest released version information -->
@@ -115,6 +116,12 @@ FCToggleButton toggle = new FCToggleButton()
115116
toggle.addValueChangeListener(e ->
116117
Notification.show("Toggle is now: " + (e.getValue() ? "on" : "off")));
117118

119+
// Enable label highlighting (active side uses primary color, inactive side is dimmed)
120+
FCToggleButton toggle = new FCToggleButton()
121+
.setLeftLabel("Off")
122+
.setRightLabel("On")
123+
.withHighlightLabel();
124+
118125
// Apply theme variants
119126
toggle.addThemeVariants(FCToggleButtonVariant.PRIMARY);
120127
toggle.addThemeVariants(FCToggleButtonVariant.CONTRAST);

0 commit comments

Comments
 (0)