
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@ewc-lib/ewc-icon-button-group
Advanced tools
The EWC Icon-button group component provides standardized radiobuttons for Eurostat web applications. It offers a consistent visual identity across Eurostat digital products while allowing for customization to meet specific application needs.

The component shows a group of icon-buttons, displayed in "pill-"design and behaving like radio-buttons - i.e. only one button can be in "pressed" state at any time.
The ewc-icon-button-group HTML tag encloses ewc-icon-buttons. It modifies their style, handles events and implements the logic.
Note that adding/removing children at runtime is not supported.
Regarding focus, arrow keys work alongside the tab key.
Within a button-group, only buttons that are not currently pressed and not disabled can be focussed.
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
| selectedIndex | selectedIndex | Number | 0 | The 0-based ordinal number of the button pressed. |
| selectedId | selectedId | Number | - | The id of the button pressed. Can be null if the id attribute is not set. |
| breakpoint | breakpoint | CSS String | 650px | if viewport width is smaller than this, the buttons are displayed without label. |
| selectedElement | HTML element | - | The HTML element currently selected. Read only. |
Notes:
While selection is handled via attributes and properties, enabling/disabling is done with the following public member functions.
setEnabledById(id, isEnabled)
setEnabledByIndex(index, isEnabled)
Example code for toggling between state "disabled" and "false"
const button = document.getElementById("myButton")
const group = document.getElementById("myButtonGroup")
group.setEnabledByIndex(0, button.state==="disabled")
❗ Don't miss to see also usage-examples/ directory for more examples, especially how to handle enable/disabling of a single button and also all buttons at once.
Please see usage-examples/ directory which contains working source-code demonstrating how this works.

npm install @ewc-lib/ewc-icon-button-group
Import the component in your application:
// Using ES modules
import "@ewc-lib/ewc-css-common/custom-props.css"
import '@ewc-lib/ewc-icon-button-group';
Example:
<ewc-icon-button-group selectedIndex="1" breakpoint="1000px">
<ewc-icon-button icon="linechart" use-config="grp-linechart" label="Line chart"></ewc-icon-button>
<ewc-icon-button icon="barchart" use-config="grp-barchart" label="Bar chart"></ewc-icon-button>
</ewc-icon-button-group>
To use a standard ewc-icon-button in the context of ewc-icon-button-group, use-config must be specified. For an explanation about the attribute use-config, please refer to the readme.md of ewc-icon-button.
Note: The usage-example/ directory contains a working example.
Referring to a button in a group can now be done via ID, additionally to the previously existing index.
e.detail was only a number before (containing an ordinal index). Now it's an object w/ 2 fields: index and id.
document.getElementById("lightEnabled").addEventListener("action",(e)=>{
console.log("button clicked or selected w/ kdb: ", e.detail.id, e.detail.index)
})
The ID is taken from the HTML tag's "id" attribute. If it's missing, e.detail.id is null.
The component is designed with accessibility in mind:
European Union Public License (EUPL)
3.1.1-alpha
3.1.0-alpha
3.0.0-alpha
2.0.3-alpha
2.0.2-alpha
2.0.1-alpha
1.0.2-alpha
1.0.1-alpha
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.