Socket
Socket
Sign inDemoInstall

@material-ui/utils

Package Overview
Dependencies
13
Maintainers
8
Versions
51
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @material-ui/utils

Utility functions for React components.


Version published
Maintainers
8
Created

Package description

What is @material-ui/utils?

The @material-ui/utils package provides a collection of utility functions and helpers designed for use with Material-UI, a popular React UI framework. These utilities help with common tasks in application development such as event handling, component styling, and theme customization.

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

useControlled

This utility helps manage the state of controlled and uncontrolled components, making it easier to implement components that can operate in both modes.

import { useControlled } from '@material-ui/utils';
const [value, setValue] = useControlled({
  controlled: controlledProp,
  default: defaultValue,
});

useEventCallback

Ensures the stability of event handlers across re-renders, which can be particularly useful in components that rely on stable references to functions.

import { useEventCallback } from '@material-ui/utils';
const handleClick = useEventCallback((event) => {
  // handle the event
});

getScrollbarSize

This function calculates the size of the scrollbar on the page, which can be useful for adjusting layout or compensating for scrollbars in overflow scenarios.

import { getScrollbarSize } from '@material-ui/utils';
const scrollbarWidth = getScrollbarSize();

Other packages similar to @material-ui/utils

Changelog

Source

@mui/joy@5.0.0-beta.0

  • <!-- 10 -->[joy] Refine the default theme (#36843) @siriwatknp

Readme

Source

@material-ui/utils

Shared utilities used by Material-UI packages.

Keywords

FAQs

Last updated on 01 Jul 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc