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

@bolttech/atoms-chip

Package Overview
Dependencies
Maintainers
0
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bolttech/atoms-chip

A versatile React chip component for displaying tags or small interactive elements.

  • 0.17.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Chip Component

A versatile React chip component for displaying tags or small interactive elements.

Installation

Use the package manager npm or yarn to install the component.

npm install @bolttech/frontend-foundations @bolttech/atoms-chip

or

yarn add @bolttech/frontend-foundations @bolttech/atoms-chip

Props

The Chip component accepts the following properties:

PropTypeDescription
textChipstringThe text content of the chip.
iconLeftstringThe name of the icon to be displayed on the left side of the chip.
iconRightstringThe name of the icon to be displayed on the right side of the chip.
sizeVariantstringThe size variant of the chip (e.g., 'small', 'medium', 'large').
fullWidthbooleanBoolean representing if the Chip is full width.
disabledbooleanDisables the chip interaction when set to true.
selectedbooleanDetermines whether the chip is selected or not.
onClickfunctionCallback function to handle the chip click event.
dataTestIdstringThe data-testid attribute for testing.

Usage

import React, { useState } from 'react';
import { Chip } from '@bolttech/atoms-checkbox';
import { bolttechTheme, BolttechThemeProvider } from '@bolttech/frontend-foundations';

const ExampleComponent = () => {
  const [isChipSelected, setIsChipSelected] = useState(false);

  const handleChipClick = (isSelected) => {
    setIsChipSelected(isSelected);
  };

  return (
    <BolttechThemeProvider theme={bolttechTheme}>
      <Chip textChip="Tag Example" iconLeft="local_offer" sizeVariant="small" disabled={false} selected={isChipSelected} onClick={handleChipClick} dataTestId="custom-chip" fullWidth={true} />
    </BolttechThemeProvider>
  );
};

export default ExampleComponent;

Contributing

Contributions are welcome! For any bug fixes, improvements, or new features, please open an issue or submit a pull request.

Please make sure to follow the code standards and test your changes before submitting.

FAQs

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