Socket
Book a DemoInstallSign in
Socket

@cypress-design/vue-icon

Package Overview
Dependencies
Maintainers
1
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cypress-design/vue-icon

## Summary

npmnpm
Version
0.12.1
Version published
Weekly downloads
4.9K
63.1%
Maintainers
1
Weekly downloads
 
Created
Source

Icon

Summary

Use the <icon> component to display an icon from the cypress figma library.

Usage

2 methods exist to load this component:

The recommended:

  • Tree shakable
  • Complete proper TS validation of all props inline
  • No auto-importation of the component in the template
<script setup>
import { IconBookCode } from @cypress-design/vue-icon
</script>
<template>
  <IconBookCode />
</template>

The simplest:

  • Allows for quick browsing of the available icons right in the template
  • Allows passing ids around and delegating color and size until the implementation.
  • it prevents tree shaking.
  • It use TypeScript to validate sizes and colors but with a twist:
    • If the size of the icon is not available for the icon selected and is available for another, the error will appear on the icon component instead of on the size prop.
<script setup>
import Icon from @cypress-design/vue-icon
</script>
<template>
  <Icon name="book-code" />
</template>

Should you need to change the color of the icon on hover or focus prefix the props with these words.

Here, the strokeColor will change on hover from indigo to jade

<script setup>
import { IconBook } from '@cypress-design/vue-icon'
</script>
<template>
  <button>
    <IconBook
      size="16"
      strokeColor="blue-600"
      hoverStrokeColor="jade-600"
    />Read
  </button>
</template>

If you need the hover or focus effect to be triggered on the parent group, use interactiveColorsOnGroup. This prop will change all the pseudo prefixes to be group focused instead of triggered by the icon itself.

To achieve the same goal, in WindiCSS, we would use group-hover: instead of hover:.

<script setup>
import { IconBook } from '@cypress-design/vue-icon'
</script>
<template>
  <button class="group hover:text-jade-800">
    <IconBook
      size="16"
      strokeColor="blue-600"
      hoverStrokeColor="jade-600"
      interactiveColorsOnGroup
    />Read
  </button>
</template>

install

npm install @cypress-design/vue-icon

or with yarn

yarn add @cypress-design/vue-icon

FAQs

Package last updated on 25 Oct 2022

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