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

@chakra-ui/icon

Package Overview
Dependencies
Maintainers
3
Versions
435
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/icon

A base React component for icons

  • 0.0.0-dev-20221128185230
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
346K
decreased by-40.58%
Maintainers
3
Weekly downloads
 
Created

What is @chakra-ui/icon?

@chakra-ui/icon is a package from the Chakra UI library that provides a set of customizable and accessible icons for React applications. It allows developers to easily integrate icons into their UI components with consistent styling and behavior.

What are @chakra-ui/icon's main functionalities?

Basic Icon Usage

This feature allows you to use any icon from popular icon libraries like FontAwesome by importing the icon and using it with the `Icon` component from @chakra-ui/icon. The `as` prop specifies the icon, and you can customize its size and color.

import { Icon } from '@chakra-ui/icon';
import { FaBeer } from 'react-icons/fa';

function Example() {
  return <Icon as={FaBeer} w={8} h={8} color="teal.500" />;
}

Custom SVG Icons

This feature allows you to create custom SVG icons by defining the SVG path within the `Icon` component. The `viewBox` and `color` props help in customizing the icon's appearance.

import { Icon } from '@chakra-ui/icon';

function CustomIcon() {
  return (
    <Icon viewBox="0 0 200 200" color="red.500">
      <path
        fill="currentColor"
        d="M100 100c-20 0-36 16-36 36s16 36 36 36 36-16 36-36-16-36-36-36z"
      />
    </Icon>
  );
}

Icon Button

This feature allows you to create buttons with icons using the `IconButton` component. The `icon` prop specifies the icon to be used, and `aria-label` provides accessibility support.

import { IconButton } from '@chakra-ui/button';
import { FaSearch } from 'react-icons/fa';

function SearchButton() {
  return <IconButton icon={<FaSearch />} aria-label="Search" />;
}

Other packages similar to @chakra-ui/icon

Keywords

FAQs

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

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