Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

abaabil.button

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abaabil.button

  • 0.0.6
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

Button Component

The Button component is a versatile and accessible button implementation that can be used for various interactive elements in your application.

Installation

npm install abaabil.temp.button

Importing

Import the Button component from the package:

import Button from 'abaabil.temp.button';

Basic Usage

<Button>Click me</Button>

Examples

Standard Button

<Button>Click me</Button>

Button with Icon

<Button icon="user">Profile</Button>

Icon-only Button

<Button icon="settings" ariaLabel="Settings" />

Button with Action Icon

<Button actionIcon="arrow-right">Next</Button>

Disabled Button

<Button disabled>Unavailable</Button>
<Button as="a" href="/path">Go to Page</Button>

Properties

PropertyTypeDescriptionDefaultRequired
as'button' | 'a'Renders component as button or anchor'button'No
iconstringIcon ID to display before text-No
childrenReactNodeButton content-No
actionIconstringIcon ID to display after text-No
classNamestringAdditional CSS classes-No
disabledbooleanDisables the buttonfalseNo
isPressedbooleanSets aria-pressed state-No
ariaLabelstringAccessibility label for icon-only buttons-No

The Button component also forwards all other props to the underlying element.

Styling

The Button component comes with default styling classes:

  • Base classes: max-w-full inline-flex items-center justify-center font-bold tracking-df h-df text-df px-df rounded-df
  • Enabled state: bg-stable text-on-stable hover:bg-stable-hover focus:bg-stable-focus active:bg-stable-active
  • Disabled state: bg-stable-disabled text-on-stable-disabled

You can customize the appearance using the className prop and your own CSS.

Accessibility

The Button component enhances accessibility by:

  • Using semantic HTML elements (<button> or <a>)
  • Providing proper ARIA attributes (aria-label, aria-pressed, aria-disabled)
  • Supporting keyboard interactions

Notes

  • The component uses React's forwardRef to allow ref forwarding.
  • Icons are rendered using a separate Icon component from abaabil.temp.icon. Ensure this dependency is available in your project.
  • The component uses the classnames library for conditional class application.

Keywords

FAQs

Package last updated on 15 Aug 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc