Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
abaabil.button.acc
Advanced tools
Button
is a flexible and accessible button component built with React. It supports various configurations, including rendering as a native button or anchor element. The component is designed to be highly customizable, with support for icons, custom labels, different sizes, colors, and states (e.g., disabled, pressed).
aria-pressed
, aria-disabled
, and aria-label
to ensure the button is accessible to all users.button
or an a
(anchor) element.You can install the Button
component using npm:
npm install abaabil.button.acc
To style the Button
component, you need to define custom CSS variables for colors and then incorporate these variables into your Tailwind CSS configuration.
First, add the following CSS variables to your global stylesheet, typically in your index.css
or styles.css
file:
:root {
--color-primary: #3784ff;
--color-on-primary: #ffffff;
--color-primary-hover: #6ea3f8;
--color-primary-focus: #1a6eff;
--color-primary-active: #0056e0;
--color-primary-disabled: #b0b0b0;
--color-on-primary-disabled: #ffffff;
}
These variables define the color scheme used by the Button
component for its various states (default, hover, focus, active, and disabled).
Next, extend the Tailwind CSS configuration to utilize these custom variables. Add the following to your tailwind.config.js
file:
module.exports = {
theme: {
extend: {
colors: {
primary: 'var(--color-primary)',
'on-primary': 'var(--color-on-primary)',
'primary-hover': 'var(--color-primary-hover)',
'primary-focus': 'var(--color-primary-focus)',
'primary-active': 'var(--color-primary-active)',
'primary-disabled': 'var(--color-primary-disabled)',
'on-primary-disabled': 'var(--color-on-primary-disabled)',
},
},
},
}
This setup ensures that Tailwind's utility classes for colors reference your custom variables, allowing for consistent theming across your application.
string
'button'
'button'
, 'a'
'button'
, it will render as a native <button>
element. If set to 'a'
, it will render as an anchor <a>
element.string
Icon
component will render this icon.node
string
string
string
string
'cp'
, 'sp'
, undefined
boolean
false
true
, the button is disabled and cannot be interacted with. This prop also sets the aria-disabled
attribute for accessibility.boolean
true
, the button is in a pressed or toggled state. This prop sets the aria-pressed
attribute for accessibility. Should be used for buttons that function as toggles.boolean
false
true
, the button will take up the full width of its container.string
React.Ref
object
Icon-only Buttons: When an icon is used without accompanying text (children
), the aria-label
prop must be provided. This ensures that screen readers can announce the purpose of the button.
aria-pressed: The aria-pressed
attribute is conditionally applied only when isPressed
is explicitly set. This is particularly important for toggle buttons to communicate their state to assistive technologies.
Keyboard Navigation: The component ensures proper keyboard navigation by setting the correct element type or role and ensuring focus styles are visible.
<Button>
Click Me
</Button>
<Button icon="plus">
Add Item
</Button>
<Button icon="settings" aria-label="Settings" />
<Button isPressed={true}>
Toggle On
</Button>
<Button fullWidth>
Full Width Button
</Button>
<Button as="a" href="https://example.com">
Visit Example
</Button>
aria-label
for icon-only buttons to ensure that the button’s purpose is clear to screen reader users.isPressed
for toggle buttons to clearly communicate the button's state to all users.FAQs
Unknown package
We found that abaabil.button.acc 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.