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

A customizable button component for React with various styles and sizes.

  • 1.0.2
  • unpublished
  • npm
  • Socket score

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

abaabil.button

A customizable button component for React with various styles and sizes.

Installation

npm install abaabil.button

Usage

import React from 'react';
import Button from 'abaabil.button';

function MyApp() {
  return (
    <Button
      size="medium"
      text="Click me"
      type="button"
      variant="primary"
      iconName="myIcon"
      style={{ color: 'red' }}
      onClick={() => console.log('clicked')}
      disabled={false}
      className="my-button"
      ariaPressed={false}
    />
  );
}

Props

  • size (string, default: medium): Size of the button.
    • small: Smaller button with reduced padding and font size.
    • medium: Regular sized button.
    • large: Larger button with increased padding and font size.
  • text (string): Text to display inside the button.
  • type (string, default: button): HTML button type attribute. Options are:
    • button
    • submit
    • reset
  • variant (string, default: primary): Style variant of the button. Options include:
    • primary: Primary color scheme button.
    • secondary: Secondary color scheme button.
    • success: Indicates success with a green color scheme.
    • warning: Indicates caution with a yellow color scheme.
    • danger: Indicates danger or a negative action with a red color scheme.
    • info: Informational, typically displayed with a blue color scheme.
  • iconName (string): Name of the icon from abaabil.icon.
  • style (object): Inline styles for the button element.
  • onClick (function): Handler function to be called when the button is clicked.
  • disabled (boolean, default: false): Disable the button when true.
  • className (string): Additional CSS class name(s) to be applied.
  • ariaPressed (boolean, default: false): ARIA pressed state.

Example with all props

import React from 'react';
import Button from 'abaabil.button';

function MyApp() {
  return (
    <>
      <Button
        size="medium"
        text="Click me"
        type="button"
        variant="primary"
        iconName="myIcon"
        style={{ color: 'red' }}
        onClick={() => console.log('clicked')}
        disabled={false}
        className="my-button"
        ariaPressed={false}
      />

      <Button
        size="small"
        text="Click me"
        type="submit"
        variant="secondary"
        iconName="myIcon"
        style={{ color: 'red' }}
        onClick={() => console.log('clicked')}
        disabled={false}
        className="my-button"
        ariaPressed={false}
      />

      <Button
        size="large"
        text="Click me"
        type="reset"
        variant="success"
        iconName="myIcon"
        style={{ color: 'red' }}
        onClick={() => console.log('clicked')}
        disabled={false}
        className="my-button"
        ariaPressed={false}
      />
    </>
  );
}

License

MIT

Keywords

FAQs

Package last updated on 14 Oct 2023

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