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

abaabil.button

Package Overview
Dependencies
Maintainers
0
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abaabil.button

  • 0.0.19
  • unpublished
  • npm
  • Socket score

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

Button Component

npm version npm downloads

The Button component is a versatile and customizable button component built with React. It supports different variants, sizes, icons, and states, making it suitable for a wide range of use cases.

Usage

import * as React from 'react';
import Button from './path-to-button';

const App = () => (
  <div>
    <Button variant="primary" size="base">Primary Button</Button>
    <Button variant="secondary" size="lg" icon="settings">Secondary Button</Button>
    <Button variant="success" size="sm" actionIcon="check" fullWidth>Success Button</Button>
    <Button variant="error" outlined>Outlined Error Button</Button>
    <Button variant="tertiary" disabled>Tertiary Disabled Button</Button>
  </div>
);

export default App;

Props

PropTypeDefaultDescription
asstringbuttonThe HTML element or React component to render.
iconstringnullIcon to display in the button. Uses the Icon component.
actionIconstringnullIcon to display on the right side of the button. Uses the Icon component.
variantstringprimaryThe button variant. Can be primary, secondary, tertiary, success, or error.
sizestringbaseThe size of the button. Can be sm, base, or lg.
disabledbooleanfalseWhether the button is disabled.
outlinedbooleanfalseWhether the button is outlined.
childrennodenullThe content of the button.
isPressedbooleanfalseThe pressed state of the button.
classNamestring''Additional class names to apply to the button.
fullWidthbooleanfalseWhether the button should take the full width of its container.
roundedbooleanfalseWhether the button should have rounded corners.
...propsobject{}Additional props to pass to the button.

Variants

  • primary: Default button style with primary background and text.
  • secondary: Secondary button style with secondary background and text.
  • tertiary: Tertiary button style with tertiary background and text.
  • success: Success button style with success background and text.
  • error: Error button style with error background and text.

Sizes

  • sm: Small button size.
  • base: Base button size.
  • lg: Large button size.

States

  • Disabled: Button with disabled prop applied. Can be combined with outlined for different styles.
  • Outlined: Button with outlined prop applied.

Icons

  • icon: Icon to display in the button, using the Icon component.
  • actionIcon: Icon to display on the right side of the button, using the Icon component.

Example

import * as React from 'react';
import Button from './path-to-button';

const Example = () => (
  <div>
    <Button variant="primary" size="base">Primary Button</Button>
    <Button variant="secondary" size="lg" icon="settings">Secondary Button</Button>
    <Button variant="success" size="sm" actionIcon="check" fullWidth>Success Button</Button>
    <Button variant="error" outlined>Outlined Error Button</Button>
    <Button variant="tertiary" disabled>Tertiary Disabled Button</Button>
  </div>
);

export default Example;

This example demonstrates various ways to use the Button component, showcasing different variants, sizes, icons, and states.

FAQs

Package last updated on 03 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