Socket
Socket
Sign inDemoInstall

@material/line-ripple

Package Overview
Dependencies
5
Maintainers
14
Versions
1662
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @material/line-ripple

The Material Components for the web line-ripple component


Version published
Weekly downloads
987K
increased by3.72%
Maintainers
14
Created
Weekly downloads
 

Readme

Source

Line Ripple

The line ripple is used to highlight user-specified input above it. When a line ripple is active, the line’s color and thickness changes.

Design & API Documentation

  • Material Design guidelines: Text Fields Layout
  • Demo with Line Ripple on Text Field

Installation

npm install @material/line-ripple

Basic Usage

HTML Structure

<span class="mdc-line-ripple"></span>

Styles

@use "@material/line-ripple/mdc-line-ripple";

JavaScript Instantiation

import {MDCLineRipple} from '@material/line-ripple';

const lineRipple = new MDCLineRipple(document.querySelector('.mdc-line-ripple'));

Style Customization

CSS Classes

CSS ClassDescription
mdc-line-rippleMandatory.
mdc-line-ripple--activeStyles the line ripple as an active line ripple.
mdc-line-ripple--deactivatingStyles the line ripple as a deactivating line ripple.

Sass Mixins

MixinDescription
active-color($color)Customizes the color of the line ripple when active.
inactive-color($color)Customizes the color of the line ripple when inactive.

MDCLineRipple Properties and Methods

Method SignatureDescription
activate() => voidProxies to the foundation's activate() method.
deactivate() => voidProxies to the foundation's deactivate() method.
setRippleCenter(xCoordinate: number) => voidProxies to the foundation's setRippleCenter(xCoordinate: number) method.

Usage Within Frameworks

If you are using a JavaScript framework, such as React or Angular, you can create a Line Ripple for your framework. Depending on your needs, you can use the Simple Approach: Wrapping MDC Web Vanilla Components, or the Advanced Approach: Using Foundations and Adapters. Please follow the instructions here.

MDCLineRippleAdapter

Method SignatureDescription
addClass(className: string) => voidAdds a class to the root element.
removeClass(className: string) => voidRemoves a class from the root element.
hasClass(className: string) => booleanDetermines whether the root element has the given CSS class name.
setStyle(propertyName: string, value: string) => voidSets the style property with propertyName to value on the root element.
registerEventHandler(eventType: EventType, handler: EventListener) => voidRegisters an event listener on the root element for a given event.
deregisterEventHandler(eventType: EventType, handler: EventListener) => voidDeregisters an event listener on the root element for a given event.

MDCLineRippleFoundation

Method SignatureDescription
activate() => voidActivates the line ripple.
deactivate() => voidDeactivates the line ripple.
setRippleCenter(xCoordinate: number) => voidSets the center of the ripple to the xCoordinate given.
handleTransitionEnd(event: Event) => voidHandles a transitionend event.

Keywords

FAQs

Last updated on 25 Mar 2024

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