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

@react-md/utils

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-md/utils

General utils for react-md.

  • 2.0.0-alpha.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
973
decreased by-57.27%
Maintainers
1
Weekly downloads
 
Created
Source

@react-md/utils

This package is mostly for internal react-md work, but it also exposes a few help SCSS mixins for handling right-to-left languages, fixing scroll momentum in iOS, determining the app size, performant resize/scroll listeners, general accessibility helpers/components, and custom focus styles.

Exported components:

  • AppSizeListener
  • ResizeListener
  • ResizeObserver
  • ScrollListener
  • MobileOnly
  • PhoneOnly
  • TabletOnly
  • DesktopOnly
  • FocusContainer

Export hooks:

  • useAppSize
  • useMediaQuery
  • useOrientation
  • useResizeListener
  • useResizeObserver
  • useCloseOnEscape
  • useFocusOnMount
  • useKeyboardMovement
  • useKeyboardSearch
  • usePreviousFocus
  • useScrollLock
  • useTabFocusWrap

Installation

$ npm install --save @react-md/utils

Usage

The main export for this package will mainly be the exposed mixins which can be included with the following import:

@import "~@react-md/utils/dist/mixins";

@include rmd-utils-base;

.custom-class {
  @include rmd-utils-rtl {
    margin-left: auto;
    margin-right: 1rem;
  }

  margin-left: 1rem;
}

.button {
  @include rmd-utils-hide-focus-outline;
}

Usage with other packages

One of the great things about this package is that there is a mixin that will automatically include all the react-md styles for packages you have included in this file.

@import "~@react-md/app-bar/dist/mixins";
@import "~@react-md/avatar/dist/mixins";
@import "~@react-md/button/dist/mixins";
@import "~@react-md/elevation/dist/mixins";
@import "~@react-md/utils/dist/mixins";

@include react-md-utils;

The example above will automatically include the styles for the app-bar, avatar, and button packages as well as the base styles utils styles.

Keywords

FAQs

Package last updated on 18 Dec 2019

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