
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@spectrum-web-components/action-button
Advanced tools
An `<sp-action-button>` represents an action a user can take.
An <sp-action-button>
represents an action a user can take.
yarn add @spectrum-web-components/action-button
Import the side effectful registration of <sp-action-button>
via:
import '@spectrum-web-components/action-button/sp-action-button.js';
When looking to leverage the ActionButton
base class as a type and/or for extension purposes, do so via:
import { ActionButton } from '@spectrum-web-components/action-button';
<sp-action-button>Try me</sp-action-button>
<sp-action-button>
elements can be provided a visible label,
a label and an icon, or just an icon.
An icon is provided by placing an icon element in the icon
slot.
If the button is icon-only
, a non-visible label
can be provided via the label
attribute on an <sp-action-button>
or on an <sp-icon*>
element child to appropriately
fulfill the accessibility contract of the button.
<sp-action-button variant="primary">Label only</sp-action-button>
Icon + label
<sp-action-button variant="primary">
<sp-icon-help slot="icon"></sp-icon-help>
Icon + Label
</sp-action-button>
SVG Icon + label
<sp-action-button variant="primary">
<svg
slot="icon"
viewBox="0 0 36 36"
focusable="false"
aria-hidden="true"
role="img"
>
<path
d="M16 36a4.407 4.407 0 0 0 4-4h-8a4.407 4.407 0 0 0 4 4zm9.143-24.615c0-3.437-3.206-4.891-7.143-5.268V3a1.079 1.079 0 0 0-1.143-1h-1.714A1.079 1.079 0 0 0 14 3v3.117c-3.937.377-7.143 1.831-7.143 5.268C6.857 26.8 2 26.111 2 28.154V30h28v-1.846C30 26 25.143 26.8 25.143 11.385z"
></path>
</svg>
SVG Icon + Label
</sp-action-button>
Icon only
<sp-action-button variant="primary" label="Icon only">
<sp-icon-help slot="icon"></sp-icon-help>
</sp-action-button>
<sp-action-group size="xs">
<sp-action-button>Edit</sp-action-button>
<sp-action-button>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit">
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
Small
<sp-action-group size="s">
<sp-action-button>Edit</sp-action-button>
<sp-action-button>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit">
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
Medium
<sp-action-group size="m">
<sp-action-button>Edit</sp-action-button>
<sp-action-button>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit">
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
Large
<sp-action-group size="l">
<sp-action-button>Edit</sp-action-button>
<sp-action-button>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit">
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
Extra Large
<sp-action-group size="xl">
<sp-action-button>Edit</sp-action-button>
<sp-action-button>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit">
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
The <sp-action-button>
can be customized with either or both of the emphasized
and quiet
attributes. These will pair with either or both of the state attributes (selected
and disabled
) to decide the final visual delivery of the <sp-action-button>
. Content addressed to the icon
slot can also be provided and will be positioned just before the rest of the the supplied button content.
<div
style="display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2em;"
>
<div>
<sp-field-label for="standard">Default</sp-field-label>
<sp-action-group id="standard">
<sp-action-button>Edit</sp-action-button>
<sp-action-button>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit">
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
<div>
<sp-field-label for="standard-selected">Selected</sp-field-label>
<sp-action-group id="standard-selected">
<sp-action-button selected>Edit</sp-action-button>
<sp-action-button selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" selected hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
<div>
<sp-field-label for="standard-disabled">Disabled</sp-field-label>
<sp-action-group id="standard-disabled">
<sp-action-button disabled>Edit</sp-action-button>
<sp-action-button disabled>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" disabled>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" disabled hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
<div>
<sp-field-label for="standard-disabled-selected">
Disabled + Selected
</sp-field-label>
<sp-action-group id="standard-disabled-selected">
<sp-action-button disabled selected>Edit</sp-action-button>
<sp-action-button disabled selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" disabled selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" disabled selected hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
</div>
Quiet
<div
style="display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2em;"
>
<div>
<sp-field-label for="standard">Default</sp-field-label>
<sp-action-group quiet id="standard">
<sp-action-button quiet>Edit</sp-action-button>
<sp-action-button quiet>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" quiet>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" quiet hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
<div>
<sp-field-label for="standard-selected">Selected</sp-field-label>
<sp-action-group quiet id="standard-selected">
<sp-action-button quiet selected>Edit</sp-action-button>
<sp-action-button quiet selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" quiet selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" quiet selected hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
<div>
<sp-field-label for="standard-disabled">Disabled</sp-field-label>
<sp-action-group quiet id="standard-disabled">
<sp-action-button quiet disabled>Edit</sp-action-button>
<sp-action-button quiet disabled>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" quiet disabled>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" quiet disabled hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
<div>
<sp-field-label for="standard-disabled-selected">
Disabled + Selected
</sp-field-label>
<sp-action-group quiet id="standard-disabled-selected">
<sp-action-button quiet disabled selected>Edit</sp-action-button>
<sp-action-button quiet disabled selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" quiet disabled selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button
label="Edit"
quiet
disabled
selected
hold-affordance
>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
</div>
Emphasized
<div
style="display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2em;"
>
<div>
<sp-field-label for="standard">Default</sp-field-label>
<sp-action-group emphasized id="standard">
<sp-action-button emphasized>Edit</sp-action-button>
<sp-action-button emphasized>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" emphasized>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" emphasized hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
<div>
<sp-field-label for="standard-selected">Selected</sp-field-label>
<sp-action-group emphasized id="standard-selected">
<sp-action-button emphasized selected>Edit</sp-action-button>
<sp-action-button emphasized selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" emphasized selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" emphasized selected hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
<div>
<sp-field-label for="standard-disabled">Disabled</sp-field-label>
<sp-action-group emphasized id="standard-disabled">
<sp-action-button emphasized disabled>Edit</sp-action-button>
<sp-action-button emphasized disabled>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" emphasized disabled>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" emphasized disabled hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
<div>
<sp-field-label for="standard-disabled-selected">
Disabled + Selected
</sp-field-label>
<sp-action-group emphasized id="standard-disabled-selected">
<sp-action-button emphasized disabled selected>
Edit
</sp-action-button>
<sp-action-button emphasized disabled selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" emphasized disabled selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button
label="Edit"
emphasized
disabled
selected
hold-affordance
>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
</div>
Emphasized + quiet
<div
style="display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2em;"
>
<div>
<sp-field-label for="standard">Default</sp-field-label>
<sp-action-group emphasized quiet id="standard">
<sp-action-button emphasized quiet>Edit</sp-action-button>
<sp-action-button emphasized quiet>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" emphasized quiet>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button label="Edit" emphasized quiet hold-affordance>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
<div>
<sp-field-label for="standard-selected">Selected</sp-field-label>
<sp-action-group emphasized quiet id="standard-selected">
<sp-action-button emphasized quiet selected>Edit</sp-action-button>
<sp-action-button emphasized quiet selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" emphasized quiet selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button
label="Edit"
emphasized
quiet
selected
hold-affordance
>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
<div>
<sp-field-label for="standard-disabled">Disabled</sp-field-label>
<sp-action-group emphasized quiet id="standard-disabled">
<sp-action-button emphasized quiet disabled>Edit</sp-action-button>
<sp-action-button emphasized quiet disabled>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" emphasized quiet disabled>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button
label="Edit"
emphasized
quiet
disabled
hold-affordance
>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
<div>
<sp-field-label for="standard-disabled-selected">
Disabled + Selected
</sp-field-label>
<sp-action-group emphasized quiet id="standard-disabled-selected">
<sp-action-button emphasized quiet disabled selected>
Edit
</sp-action-button>
<sp-action-button emphasized quiet disabled selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
Edit
</sp-action-button>
<sp-action-button label="Edit" emphasized quiet disabled selected>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-action-button
label="Edit"
emphasized
quiet
disabled
selected
hold-affordance
>
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
</sp-action-group>
</div>
</div>
The use of the hold-affordance
attribute signifies that the <sp-action-button>
in question will be delivered with a visual affordance outlining that special interaction with the button will dispatch a longpress
event. Via a pointer input, this even will be dispatched when 300ms has passed after a pointerdown
event without the presence of a pointerup
or pointercancel
event. Via the keyboard, an event with a code of Space
or or ArrowDown
while altKey === true
will dispatch the event.
<div
style="display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2em;"
>
<overlay-trigger placement="bottom-start">
<sp-action-button label="Edit" hold-affordance slot="trigger">
<sp-icon-edit slot="icon"></sp-icon-edit>
</sp-action-button>
<sp-popover slot="longpress-content" dialog tip>
<p style="color: var(--spectrum-neutral-content-color-default);">
This content is triggered by the "longpress" interaction.
</p>
</sp-popover>
</overlay-trigger>
<overlay-trigger placement="top">
<sp-action-button hold-affordance quiet slot="trigger">
Show Longpress Content
</sp-action-button>
<sp-popover slot="longpress-content" dialog tip>
<p style="color: var(--spectrum-neutral-content-color-default);">
This content is triggered by the "longpress" interaction.
</p>
</sp-popover>
</overlay-trigger>
<overlay-trigger placement="top-end">
<sp-action-button hold-affordance selected slot="trigger">
<sp-icon-edit slot="icon"></sp-icon-edit>
Extended Content with Longpress
</sp-action-button>
<sp-popover slot="longpress-content" dialog tip>
<p style="color: var(--spectrum-neutral-content-color-default);">
This content is triggered by the "longpress" interaction.
</p>
</sp-popover>
</overlay-trigger>
</div>
With the application of the toggles
attribute, the button will self manage its selected
property on click
. When this value is updated, a cancellable change
event will be dispatched to inform the parent application.
<sp-action-button toggles id="toggles-default">Toggle button</sp-action-button>
<sp-action-button toggles selected id="toggles-default">
Toggle button
</sp-action-button>
Quiet
<sp-action-button toggles quiet id="toggles-quiet">
Toggle button
</sp-action-button>
<sp-action-button toggles quiet selected id="toggles-quiet">
Toggle button
</sp-action-button>
Emphasized
<sp-action-button toggles emphasized id="toggles-emphasized">
Toggle button
</sp-action-button>
<sp-action-button toggles emphasized selected id="toggles-emphasized">
Toggle button
</sp-action-button>
Emphasized + Quiet
<sp-action-button toggles emphasized quiet id="toggles-emphasized-quiet">
Toggle button
</sp-action-button>
<sp-action-button
toggles
emphasized
quiet
selected
id="toggles-emphasized-quiet"
>
Toggle button
</sp-action-button>
Events handlers for clicks and other user actions can be registered on a
<sp-action-button>
as on a standard HTML <button>
element.
<sp-button onclick="spAlert(this, '<sp-action-button> clicked!')">
Click me
</sp-button>
In addition to handling events like a native <button>
HTML element, one can also use a <sp-action-button>
in place of the <a>
HTML element by using the href
and optional target
attribute.
<sp-action-button
href="https://github.com/adobe/spectrum-web-components"
target="_blank"
>
Click me
</sp-action-button>
A button is required to have either a visible text label or a label
attribute on either the <sp-button>
itself,
or on an <sp-icon*>
element child.
Do not use custom colors for buttons. The colors of different button variations have been designed to be consistent and accessible.
To ensure maximum contrast with the background, use static black for light backgrounds and images, and static white for dark backgrounds and images. Avoid placing static components on top of busy images with a lot of variance in contrast.
Static black on light background<div style="background-color: #ccffee; padding: 20px">
<sp-action-button static="black">Click me</sp-action-button>
<sp-action-button static="black" selected>Click me</sp-action-button>
</div>
Static white on dark background
<div style="background-color: #220033; padding: 20px">
<sp-action-button static="white">Click me</sp-action-button>
<sp-action-button static="white" selected>Click me</sp-action-button>
</div>
Make sure that an action button’s label clearly states the outcome of the action. Use the same word or phrase as found elsewhere in the experience.
1.8.0 (2025-09-23)
sp-picker: Fixed escape key behavior in modal overlays containing picker components. Previously, pressing the Escape key when a picker was open inside a modal overlay would not properly close the modal, instead moving focus to the picker. Now, the escape key correctly closes the picker first (if open), then closes the modal overlay on subsequent escape key presses.
This fix adds a check for this.open
in the picker's handleEscape
method to ensure proper modal overlay closure behavior.
sp-overlay: Added allow-outside-click
property to <sp-overlay>
with deprecation notice. This property allows clicks outside the overlay to close it, but is not recommended for accessibility reasons and will be removed in a future version.
This property is being added as deprecated to support the fallback for showModal()
which was removed as part of performance optimization. We will no longer support outside clicks for modal overlays as they violate accessibility guidelines.
The property defaults to false
and shows deprecation warnings when used. Consider using explicit close buttons or modal/page overlay types instead for better accessibility.
sp-menu: Fixed : Fix iPad scrolling issue in picker dropdown where scrolling through menu items would accidentally select the first touched item and close the picker.
The fix implements touch gesture detection to distinguish between scrolling and selection. Added isScrolling
getter for public API access. Test on iPad devices with long menus to validate scrolling behavior and selection accuracy.
sp-overlay: Fixed : Added body scroll prevention for modal and page overlays. Overlay automatically blocks body scroll when modal or page overlays are open and restores the original scroll state when they are closed, improving user experience and accessibility for modal dialogs.
sp-clear-button: Clear button styles have been updated to the latest Spectrum CSS version of the clear button. This update includes a major reduction in the number of custom property abstractions needed to support the multiple theming layers (as seen in the styles
package).
This update spans the following additional packages:
As the updated styles now offer additional styling options, we have added the following API to the clear button component that exists in the button
package:
quiet
- when set to true, the button will be rendered as a quiet button. This is useful for cases where you want to use the clear button in a more subtle way.disabled
- when set to true, the button will be rendered as a disabled button.static-color
- currently this only supports the white
context color. This is useful for cases where the button appears on a dark background texture. This is a replacement for the previously used variant="overBackground"
attribute which is deprecated.The variant="overBackground"
attribute is deprecated; please use the new static-color="white"
attribute instead. When this property is used in the component, a deprecation warning will be shown in the console when in debug mode. The variant
attribute will be removed in a future release.
sp-card: Fixed the card component's CSS by moving block-size: 100%
from the base :host
selector to only apply to gallery
and quiet
variants
sp-overlay: Fixed : external click registration behavior in the sp-overlay
component. Programmatic clicks on elements outside of modal overlays now properly register and close the overlay, while user-initiated clicks are prevented from doing so.
sp-card: Enhanced the Card component's checkbox functionality with improved screen reader support and keyboard navigation.
sp-progress-bar: Added: Deprecation warning for the over-background attribute.
sp-combobox: Replace the use of offsetWidth with a resizeObserver to avoid unecessary, performance-impacting layout reflows.
sp-styles: Bring the CJK font alias token fix from CSS #3883 4e3a120
.
The --spectrum-cjk-font
token was incorrectly mapped to the code font-family stack instead of --spectrum-cjk-font-family-stack
. Thanks @byteakp!
sp-color-wheel: Fixed <sp-color-wheel>
step attribute functionality for keyboard navigation. The step attribute now properly controls the increment size when using arrow keys to navigate the color wheel.
sp-switch: ### Fix down state colors for switch
Because the postcss-hover-media-feature
plugin converts hover styles into a media query for devices that support hover, the hover styles were overriding any active/down state styles. We needed to target the active/down states of the switch with additional active state selectors, in order to ensure that the active state takes precedence over the hover state, maintaining the correct visual behavior of the switch component across different interaction states.
This fix should address hover + active state discrepancies in S1 and S2 foundations.
sp-contextual-help: Fixed a typo in the default info
variant label from "Informations" to "Information".
Additionally, added package dependency for @spectrum-web-components/reactive-controllers@1.7.0
.
sp-slider: Editable sliders will now reliably emit input
events when interaction starts with the track.
sp-link: Fixed quiet variant links not showing keyboard focus state in Safari. Links with the quiet
attribute now properly display focus indicators when navigating with keyboard, improving accessibility for keyboard users.
sp-progress-bar: Smooths the transition animation of indeterminate progress bar by overriding the incoming CSS, and positioning the animating fill element completely off of the progress bar track in both LTR and RTL languages. Before, the fill element was automatically starting on the track which led to a jarring animation loop.
sp-divider: Added: staticColor
property to the Divider component, enabling programmatic control of the existing static color functionality.
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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.