
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@rmwc/icon-button
Advanced tools
Icon buttons allow users to take actions, and make choices, with a single tap.
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
aria-label="favorite"
icon="favorite_border"
onIcon="favorite"
/>
<IconButton
aria-label="favorite"
icon="favorite"
onIcon="favorite"
disabled
/>
</>
function Controlled() {
const [isChecked, setIsChecked] = React.useState(false);
return (
<>
<IconButton
aria-label="start"
checked={isChecked}
onClick={() => setIsChecked(!isChecked)}
onIcon="star"
icon="star_border"
/>
<IconButton
aria-label="social media"
checked={isChecked}
onClick={() => setIsChecked(!isChecked)}
onIcon="images/icons/twitter.png"
icon="images/icons/facebook.png"
/>
</>
);
}
<IconButton
aria-label="red and green"
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 | boolean | Controls the on / off state of the a toggleable button. |
disabled | boolean | Makes the button disabled |
foundationRef | Ref<MDCIconButtonToggleFoundation<>> | Advanced: A reference to the MDCFoundation. Only for Toggleable buttons. |
icon | IconPropT | Icon for the button |
label | string | Apply an aria label. |
onChange | (evt: IconButtonOnChangeEventT) => void | An onChange callback that receives a custom event. evt.detail = { isOn: boolean } |
onIcon | IconPropT | If specified, renders a toggle with this icon as the on state. |
ripple | RipplePropT | Adds a ripple effect to the component |
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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.