Socket
Socket
Sign inDemoInstall

@bearei/react-tag

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bearei/react-tag

Base tag components that support React and React native


Version published
Weekly downloads
4
decreased by-69.23%
Maintainers
1
Weekly downloads
 
Created
Source

react-tag

Base tag components that support React and React native

Installation

yarn add @bearei/react-tag --save

Parameters

NameTypeRequiredDescription
iconReactNodeTag icon
closeIconReactNodeTag close button icon
colorstringTag color
borderbooleanWhether or not to display the tag border
closeIconVisiblebooleanWhether the tag close button icon is visible
disabledbooleanWhether or not to disable the Tag
loadingbooleanWhether the tag is loading
contentReactNodeTag to display content
sizesmall medium largeTag size
shapesquare circle roundTag shape
onClose(options: TagOptions) => voidThis function is called when the tag is closed
onClick(e: React.MouseEvent) => voidThis function is called when tag is clicked
onTouchEnd(e: React.TouchEvent) => voidThis function is called when the tag is pressed
onPress(e: GestureResponderEvent) => voidThis function is called when the tag is pressed -- react native
renderIcon(props: TagIconProps) => ReactNodeRender the tag icon
renderCloseIcon(props: TagCloseIconProps) => ReactNodeRender the tag close icon
renderMain(props: TagMainProps) => ReactNodeRender the tag main
renderContainer(props: TagContainerProps) => ReactNodeRender the tag container

Use

import React from 'React';
import ReactDOM from 'react-dom';
import Tag from '@bearei/react-tag';

const tag = (
  <Tag
    content="tag"
    icon={<i>"icon"</i>}
    closeIcon={<i>"closeIcon"</i>}
    renderIcon={({ children }) => <i>{children}</i>}
    renderCloseIcon={({ children }) => <i>{children}</i>}
    renderMain={({ content, ...props }) => <span {...props}>{content}</span>}
    renderContainer={({ id, children }) => (
      <div data-id={id} tabIndex={1}>
        {children}
      </div>
    )}
  />
);

ReactDOM.render(tag, container);

Keywords

FAQs

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