Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@rmwc/icon-button
Advanced tools
Icon buttons allow users to take actions, and make choices, with a single tap.
IconButton
inherits from the Icon
component and can be passed icons in the same way.
<>
<IconButton icon="star" label="Rate this!" />
<IconButton icon="favorite" label="Favorite" disabled />
<IconButton
icon="images/icons/twitter.png"
aria-label="Tweet it!"
tag="a"
target="_blank"
href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(
'You should definitely be using RMWC for your next project! https://rmwc.io'
)}`}
/>
</>
To use as a toggle, specify an additional toggled on state using 'onIcon'.
<>
<IconButton icon="favorite_border" onIcon="favorite" />
<IconButton icon="favorite" onIcon="favorite" disabled />
</>
function Controlled() {
const [isChecked, setIsChecked] = React.useState(false);
return (
<>
<IconButton
checked={isChecked}
onClick={() => setIsChecked(!isChecked)}
onIcon="star"
icon="star_border"
/>
<IconButton
checked={isChecked}
onClick={() => setIsChecked(!isChecked)}
onIcon="images/icons/twitter.png"
icon="images/icons/facebook.png"
/>
</>
);
}
<IconButton
onIcon={
<div
style={{
background: 'red',
width: '24px',
height: '24px'
}}
/>
}
icon={
<div
style={{
background: 'green',
width: '24px',
height: '24px',
borderRadius: '50%'
}}
/>
}
/>
An IconButton component that can also be used as a toggle.
Name | Type | Description |
---|---|---|
checked | undefined | false | true | Controls the on / off state of the a toggleable button. |
disabled | undefined | false | true | Makes the button disabled |
foundationRef | React.Ref<MDCIconButtonToggleFoundation> | Advanced: A reference to the MDCFoundation. Only for Toggleable buttons. |
icon | RMWC.IconPropT | Icon for the button |
label | undefined | string | Apply an aria label. |
onChange | undefined | (evt: IconButtonOnChangeEventT) => void | An onChange callback that receives a custom event. evt.detail = { isOn: boolean } |
onIcon | RMWC.IconPropT | If specified, renders a toggle with this icon as the on state. |
FAQs
Icon buttons allow users to take actions, and make choices, with a single tap.
The npm package @rmwc/icon-button receives a total of 4,345 weekly downloads. As such, @rmwc/icon-button popularity was classified as popular.
We found that @rmwc/icon-button demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.