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

@leafygreen-ui/chip

Package Overview
Dependencies
Maintainers
6
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/chip

LeafyGreen UI Kit Chip

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15K
increased by685.3%
Maintainers
6
Weekly downloads
 
Created
Source

Chip

npm (scoped)

View on MongoDB.design

Installation

Yarn

yarn add @leafygreen-ui/chip

NPM

npm install @leafygreen-ui/chip

Example

import { Chip } from `@leafygreen-ui/chip`;

<Chip label="leafygreen" />

or

<Chip
  label="leafygreen"
  variant="blue"
  baseFontSize={13}
  disabled
  onDismiss={() => {}}
  popoverZIndex={1}
  chipCharacterLimit={10}
  chipTruncationLocation="end"
  dismissButtonAriaLabel="aria-label"
  darkMode
/>

Properties

PropTypeDescriptionDefault
labelReact.ReactNodeLabel rendered in the chip
chipTruncationLocation'end' | 'middle' | 'none' | 'start'Defines where the ellipses will appear in a Chip when the label length exceeds the chipCharacterLimit. If none is passed, the chip will not truncate. Note: If there is any truncation, the full label text will appear inside a tooltip on hovernone
chipCharacterLimitnumberDefines the character limit of a Chip before they start truncating. Note: the three ellipses dots are included in the character limit and the chip will only truncate if the chip length is greater than the chipCharacterLimit.
popoverZIndexnumberNumber that controls the z-index of the tooltip containing the full label text.
baseFontSize'13' | '16'Determines the base font-size of the chip.
variant'gray' | 'blue' | 'green' | 'purple' | 'red' | 'yellow' | 'blue'The color of the chip.
disabledbooleanDetermines if the chip should be disabled.false
onDismissReact.MouseEventHandler<HTMLButtonElement>Callback when dismiss button is clicked. If set, a dismiss button will render.
dismissButtonAriaLabelstringaria-label for the dismiss button.${label} deselect
darkModebooleanRender the component in dark mode.false
...native span attributesAny other props will be spread on the root span element

FAQs

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