npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@s-ui/react-atom-tag

v2.55.0

Published

> Atom Element: SUI Tag

Downloads

9,435

Readme

AtomTag

Atom Element: SUI Tag

We use tags to visually emphasise features of the UI and make recognition and interaction easier.

Installation

npm install @s-ui/react-atom-tag --save

Usage

import AtomTag from '@s-ui/react-atom-tag'

<AtomTag label='Tag Structure' />

Size

Tags structure can have 3 main sizes: Small, medium (default) and large. You can use this prop size to modify it.

small | medium (default) | large

<AtomTag
  label="Structure Tag"
  size="small"
/>

<AtomTag
  label="Structure Tag"
  size="medium"
/>

<AtomTag
  label="Structure Tag"
  size="large"
/>

Design

Tags structure can have 2 designs: Solid (default) and outline. You can use this prop design to modify it.

solid (default) | outline

<AtomTag
  label="Structure Tag"
  design="solid"
/>

<AtomTag
  label="Structure Tag"
  design="outline"
/>

Actionable

Actionable tags can be used as an anchor. Same as <a> to define an interactivity with the component.

<AtomTag
  label="Navigation Tag"
  onClick={() => alert('click!')}
/>

<AtomTag
  href="https://sui-components.now.sh/"
  label="Anchor Tag"
  target="_blank"
/>

Icons

Tags can include an action icon (generally a close icon). This icon will always be located to the right of content. You can add use the icon and closeIcon to added a icon.

<AtomTag label="Tag Structure Tag" icon={<Icon />} />

Responsive

Use the responsive true for make responsive layout. keep large size in mobile.

<AtomTag label="Tag Structure" responsive />

Tag types

Use the type in order to color it as desired from a high order component.

If you want to customize your tag you can pass a prop to identify this type and you also need to set your custom set of types in Sass:

Your theme file (Sass)

$atom-tag-types: (
  "alert": (
    bgc: red,
    c: white
  ),
  "warning": (
    bgc: orange,
    c: white
  )
);

Value

Use the prop value if you want to use this value on your onClick/onClose handler.

<AtomTag
  label="Tag with value"
  onClick={(_, {value}) => alert('click! this is my value', value)}
  value={42}
/>

onClose

The onClose event is triggered when the passed closeIcon is clicked. It receives the native event as first argument and an object with the passed label and value as second argument.

<AtomTag
  label="Tag with value"
  value={42}
  onClose={(_, {value, label}) => alert('Click! These are my value and label', {value, label})}
  closeIcon={<IconClose />}
/>

Your high order component

<AtomTag type="alert" />

Find full description and more examples in the demo page.