
Security News
TC39 Advances Temporal to Stage 4 Alongside Several ECMAScript Proposals
TC39’s March 2026 meeting advanced eight ECMAScript proposals, including Temporal reaching Stage 4 and securing its place in the ECMAScript 2026 specification.
@asphalt-react/button
Advanced tools
Buttons provide a way to trigger an action. The caption of a Button should hint what action it'll perform. The caption is typically text but Buttons can also have an icon with text or just an icon (which we call as Icon Button).
Buttons come in 4 variants to emphasize different levels:
There are 3 intents, which paired with the above variants address multiple supportive actions:
Variants and an intents are mutually exclusive. Button falls back to the default value if a variant or intent occurs more than once. For example, using primary and nude together will fallback to a primary variant.
Button features the ability to render a semantic link styled as a button (which we call Link Button). Link Buttons and Icon Link Buttons — icon as caption — handle security and privacy risks if the link opens in a new tab.
Button package exports a named ToggleButton component as well. A ToggleButton is a digital switch to turn an option on or off.
Buttons support 4 sizes: - extra small (xs) - small (s) - medium (m) - large (l)
Buttons's caption decides its width by default, but it can also stretch to take its container's width. The rendered button element has a type attribute set to "button". You may override the type attribute if needed.
Buttons accept React ref to give access to the underlying element. They accept most of the button element's attributes such as disabled & onClick and supports data-* attributes.
aria-checked attribute.aria-label or aria-labelledby in Icon Button & icon-only variant of ToggleButton to help assitive technologies.import { Button } from '@asphalt-react/button'
<Button>Click me</Button>
React node for button's caption
| type | required | default |
|---|---|---|
| node | true | N/A |
Renders a primary variant
| type | required | default |
|---|---|---|
| bool | false | false |
Renders a secondary variant
| type | required | default |
|---|---|---|
| bool | false | false |
Renders a tertiary variant
| type | required | default |
|---|---|---|
| bool | false | false |
Renders a nude variant
| type | required | default |
|---|---|---|
| bool | false | false |
Renders brand intent
| type | required | default |
|---|---|---|
| bool | false | false |
Renders danger intent
| type | required | default |
|---|---|---|
| bool | false | false |
Renders system intent
| type | required | default |
|---|---|---|
| bool | false | false |
Renders a link button
| type | required | default |
|---|---|---|
| bool | false | false |
Link element to render. Accepts an HTML element or a React component.
| type | required | default |
|---|---|---|
| elementType | false | "a" |
Accepts props & attributes for the link element.
| type | required | default |
|---|---|---|
| object | false | { href: "." } |
Renders an icon button
| type | required | default |
|---|---|---|
| bool | false | false |
Renders an icon button with less padding. Works only with a nude icon button. Does not support any intent.
| type | required | default |
|---|---|---|
| bool | false | false |
Qualifiers are icons that enhance the caption. Button prepends the qualifier by default
Accepts SVG or SVG wrapped React component. Checkout @asphalt-react/iconpack for SVG wrapped React components.
⚠️ Do not use
qualifierto render an icon button, useiconprop instead
| type | required | default |
|---|---|---|
| element | false | null |
Appends qualifier to the caption
| type | required | default |
|---|---|---|
| bool | false | false |
Controls size of button. Possible values are "xs", "s", "m", "l" for extra small, small, medium & large respectively
| type | required | default |
|---|---|---|
| enum | false | "m" |
Stretches Button to take it's container width
| type | required | default |
|---|---|---|
| bool | false | false |
A ToggleButton is a digital switch to turn an option on or off. Switching between the states — as a result of direct user action or a programmatic event — should produce an immediate result. The caption should always reflect the current logical state of the button.
There are two variants:
Similar to ToggleSwitches, ToggleButtons are not an alternative to Checkboxes. They are not form controls and should not appear inside a form. ToggleButtons should only manipulate local UI states, i.e. they should not directly or indirectly initiate a remote API call to change database states.
Both of them provide options to toggle between states. Consider the following points to choose between them:
import { ToggleButton } from '@asphalt-react/button'
<ToggleButton text="mute" on />
Label for text-only variant
| type | required | default |
|---|---|---|
| string | false | N/A |
Icon for icon-only variant. Accepts SVG or SVG wrapped React component
Note: icon prop overrides text prop
| type | required | default |
|---|---|---|
| node | false | N/A |
React node for caption
Note: Both icon and text props override children
| type | required | default |
|---|---|---|
| node | false | N/A |
Sets the state of button
| type | required | default |
|---|---|---|
| bool | false | false |
Sets the size of button. Possible values are "s", "m", "l" for small, medium & large respectively
| type | required | default |
|---|---|---|
| enum | false | "m" |
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.

Security News
TC39’s March 2026 meeting advanced eight ECMAScript proposals, including Temporal reaching Stage 4 and securing its place in the ECMAScript 2026 specification.

Research
/Security News
Since January 31, 2026, we identified at least 72 additional malicious Open VSX extensions, including transitive GlassWorm loader extensions targeting developers.

Research
Six malicious Packagist packages posing as OphimCMS themes contain trojanized jQuery that exfiltrates URLs, injects ads, and loads FUNNULL-linked redirects.