Socket
Socket
Sign inDemoInstall

@chakra-ui/utils

Package Overview
Dependencies
3
Maintainers
4
Versions
257
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/utils


Version published
Maintainers
4
Created

Package description

What is @chakra-ui/utils?

@chakra-ui/utils is a utility library that provides a collection of helper functions and utilities to simplify common tasks in JavaScript and React applications. It is part of the Chakra UI ecosystem and is designed to work seamlessly with Chakra UI components.

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

Array Utilities

Provides utility functions to manipulate arrays, such as removing an item from an array.

const { removeItem } = require('@chakra-ui/utils');
const array = [1, 2, 3, 4];
const newArray = removeItem(array, 2);
console.log(newArray); // Output: [1, 3, 4]

Object Utilities

Includes functions to manipulate objects, such as merging two objects together.

const { mergeWith } = require('@chakra-ui/utils');
const obj1 = { a: 1, b: 2 };
const obj2 = { b: 3, c: 4 };
const mergedObj = mergeWith(obj1, obj2);
console.log(mergedObj); // Output: { a: 1, b: 3, c: 4 }

DOM Utilities

Provides functions to interact with the DOM, such as getting the owner document of an element.

const { getOwnerDocument } = require('@chakra-ui/utils');
const element = document.getElementById('myElement');
const ownerDocument = getOwnerDocument(element);
console.log(ownerDocument); // Output: [object Document]

String Utilities

Includes functions to manipulate strings, such as capitalizing the first letter of a string.

const { capitalize } = require('@chakra-ui/utils');
const str = 'hello world';
const capitalizedStr = capitalize(str);
console.log(capitalizedStr); // Output: 'Hello world'

Function Utilities

Provides utility functions for working with functions, such as debouncing a function.

const { debounce } = require('@chakra-ui/utils');
const log = () => console.log('Debounced!');
const debouncedLog = debounce(log, 200);
debouncedLog();

Other packages similar to @chakra-ui/utils

Readme

Source

Utilities

Shared Vanilla TS/JS utilities for various Chakra UI components and packages.

**Note **: This package is intended for internal use by the Chakra UI components.

Installation

yarn add @chakra-ui/utils

FAQs

Last updated on 30 Mar 2021

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc