Socket
Socket
Sign inDemoInstall

@bearei/react-button

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bearei/react-button

Base button components that support React and React native


Version published
Maintainers
1
Created
Source

react-button

Base button components that support React and React native

Installation

yarn add @bearei/react-button --save

Parameters

NameTypeRequiredDescription
iconReactNodeButton icon
disabledbooleanWhether or not to disable the button
loadingbooleanWhether the button is loading
contentReactNodeButton to display content
sizesmall medium largeButton size
colorstringButton color
borderbooleanWhether or not to display the button border
shapesquare circle roundButton shape
typedefault primary secondary dashed ghost link textButton type
htmlTypeButtonHTMLAttributes<HTMLButtonElement>['type']HTML native button type
dangerbooleanDanger button
warningbooleanWarning button
onClick(e: React.MouseEvent) => voidThis function is called when button is clicked
onTouchEnd(e: React.TouchEvent) => voidThis function is called when the button is pressed
onPress(e: GestureResponderEvent) => voidThis function is called when the button is pressed -- react native
renderIcon(props: ButtonIconProps) => ReactNodeRender the button icon
renderMain(props: ButtonMainProps) => ReactNodeRender the button main
renderContainer(props: ButtonContainerProps) => ReactNodeRender the button container

Use

import React from 'React';
import ReactDOM from 'react-dom';
import Button from '@bearei/react-button';

const button = (
  <Button
    content="button"
    icon={<i>"icon"</i>}
    renderIcon={({ children }) => <i>{children}</i>}
    renderMain={({ content, ...props }) => (
      <button {...props} type="reset">
        {content}
      </button>
    )}
    renderContainer={({ id, children }) => (
      <div data-id={id} tabIndex={1}>
        {children}
      </div>
    )}
  />
);

ReactDOM.render(button, container);

Keywords

FAQs

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