2.45.0 • Published 3 months ago

@vonage/vwc-button-toggle-group v2.45.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

vwc-button-toggle-group

Usage

<vwc-button-toggle-group>
  <vwc-button value="11">BUTTON</vwc-button>
  <vwc-button value="12">BUTTON</vwc-button>
  <vwc-icon-button icon="home" value="22">BUTTON</vwc-button>
  <vwc-button value="13">BUTTON</vwc-button>
</vwc-button-toggle-group>

Template

<slot></slot>

API

Properties/Attributes

nameattr/prop/reflectedtypedescription
multireflectedbooleanallows for multiple selections
selected (readonly)property[]HTMLElementlist of selected items
valuesproperty[]stringThe values of the selected items. Setting this property sets the state according to the items with the values in the array
itemspropertyElement[]A list of valid toggle elements
shapereflected“pill”/”rounded”
densereflectedbooleanSet the size of the buttons as dense
enlargedreflectedbooleanSet the size of the buttons as enlarged
requiredreflectedbooleanPrevents toggling off the last selection. Also does not send event of non toggled selection.

Events

nameevent.detaildescription
selectedFires when a button is toggled

Notes for consumers:

  • No errors are thrown for misuse
    • Setting a button without a value will return a null value if selected.
    • Adding invalid button elements (supported list is in the code right now) will not be shown or handled as buttons
  • Handling selected events:
    • When handling a selected event one would probably like to query the element.values or element.selected to get the current state after the change
  • One can add more buttons dynamically
    • If you remove an item and not destroy it, remember that there’s a listener on this item
  • Selected items have the selected
  • In order to enforce styles, the following attributes are automatically altered:
    • layout - will be set layout="filled" on load (note that changing this after initial load will change the way it looks)
2.45.0

3 months ago

2.43.0

10 months ago

2.43.2

9 months ago

2.43.1

10 months ago

2.44.0

8 months ago

2.41.0

11 months ago

2.42.0

11 months ago

2.38.0

1 year ago

2.39.1

1 year ago

2.39.0

1 year ago

2.37.2

1 year ago

2.40.0

1 year ago

2.36.3

1 year ago

2.36.2

1 year ago

2.37.0

1 year ago

2.36.0

2 years ago

2.36.1

2 years ago

2.35.0

2 years ago

2.32.0

2 years ago

2.34.0

2 years ago

2.34.1

2 years ago

2.31.0

2 years ago

2.33.1

2 years ago

2.33.0

2 years ago

2.29.0

2 years ago

2.28.1

2 years ago

2.28.0

2 years ago

2.28.2

2 years ago

2.30.2

2 years ago

2.30.1

2 years ago

2.30.3

2 years ago

2.30.0

2 years ago

2.27.1

2 years ago

2.27.0

2 years ago

2.26.0

2 years ago

2.25.10

2 years ago

2.25.9

2 years ago

2.25.8

2 years ago

2.25.7

2 years ago

2.25.6

2 years ago

2.25.5

2 years ago

2.25.3

2 years ago

2.25.2

2 years ago

2.25.1

2 years ago

2.25.0

2 years ago

2.24.1

2 years ago

2.24.0

2 years ago

2.23.0

2 years ago

2.22.1

3 years ago

2.22.0

3 years ago

2.21.1

3 years ago

2.21.0

3 years ago

2.20.1

3 years ago

2.20.0

3 years ago

2.19.0

3 years ago

2.18.1

3 years ago

2.18.0

3 years ago

2.17.0

3 years ago

2.16.1

3 years ago

2.16.0

3 years ago

2.15.0

3 years ago

2.14.0

3 years ago

2.13.0

3 years ago

2.12.0

3 years ago

2.11.0

3 years ago