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

@material/floating-label

Package Overview
Dependencies
Maintainers
15
Versions
1664
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material/floating-label

The Material Components for the web floating-label component

  • 15.0.0-canary.2d26722d2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
656K
decreased by-16.89%
Maintainers
15
Weekly downloads
 
Created

What is @material/floating-label?

@material/floating-label is a package from the Material Components for the Web (MDC Web) library. It provides a floating label component that can be used in form fields to enhance user experience by animating the label when the input field is focused or filled.

What are @material/floating-label's main functionalities?

Basic Floating Label

This code snippet demonstrates how to create a basic floating label using the @material/floating-label package. The label will float above the input field when the field is focused or filled.

<div class="mdc-floating-label" id="my-label-id">My Label</div>

Floating Label with Input

This example shows how to use the floating label in conjunction with an input field. The label will float above the input field when the user interacts with it.

<div class="mdc-text-field">
  <input type="text" class="mdc-text-field__input" aria-labelledby="my-label-id">
  <label class="mdc-floating-label" id="my-label-id">My Label</label>
</div>

JavaScript Initialization

This code demonstrates how to initialize the floating label component using JavaScript. This is useful for adding dynamic behavior to the floating label.

import { MDCFloatingLabel } from '@material/floating-label';

const floatingLabel = new MDCFloatingLabel(document.querySelector('.mdc-floating-label'));

Other packages similar to @material/floating-label

Keywords

FAQs

Package last updated on 02 Dec 2022

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