Socket
Socket
Sign inDemoInstall

@chakra-ui/close-button

Package Overview
Dependencies
Maintainers
2
Versions
443
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/close-button

A React and Chakra UI close button component.


Version published
Weekly downloads
598K
increased by7.93%
Maintainers
2
Weekly downloads
 
Created

What is @chakra-ui/close-button?

@chakra-ui/close-button is a component from the Chakra UI library that provides a customizable close button. It is typically used to close modals, alerts, or any other dismissible elements in a user interface.

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

Basic Close Button

This code demonstrates how to use the basic CloseButton component from the @chakra-ui/close-button package. It renders a simple close button.

import { CloseButton } from '@chakra-ui/close-button';

function App() {
  return <CloseButton />;
}

Custom Size

This code shows how to render a CloseButton with a custom size. The 'size' prop can be used to adjust the button's size.

import { CloseButton } from '@chakra-ui/close-button';

function App() {
  return <CloseButton size='lg' />;
}

Custom Color

This code demonstrates how to customize the color of the CloseButton. The 'color' prop allows you to set the button's color.

import { CloseButton } from '@chakra-ui/close-button';

function App() {
  return <CloseButton color='red.500' />;
}

Event Handling

This code shows how to handle click events on the CloseButton. The 'onClick' prop can be used to specify a function to be called when the button is clicked.

import { CloseButton } from '@chakra-ui/close-button';

function App() {
  const handleClose = () => {
    alert('Close button clicked!');
  };

  return <CloseButton onClick={handleClose} />;
}

Other packages similar to @chakra-ui/close-button

Keywords

FAQs

Package last updated on 18 Jul 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