Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@material/floating-label
Advanced tools
Changelog
14.0.0 (2022-04-27)
unset
is unsupported in IE. (f460e23)validateTooltipWithCaretDistances
method. (3e30054)theme-styles
mixin... the value being retreived from the $theme
map and css property name was swapped. The mixin would request font-size
/font-weight
/letter-spacing
from the $theme
map (which expects size
/weight
/tracking
)... so these values would always be null
. (32b3913)attachTo
. (05db65e)showTimeout
is not set (indicating that this tooltip is about to be re-shown). (6ca8b8f)minRange
param to range sliders to request a minimum gap between the two thumbs. (8fffcb5)valueToAriaValueTextFn
and valueToValueIndicatorTextFn
functions are called for. (b6510c8)PiperOrigin-RevId: 444830518
PiperOrigin-RevId: 419837612
Readme
Floating labels display the type of input a field requires. Every Text Field and Select should have a label, except for full-width text fields, which use the input's placeholder
attribute instead. Labels are aligned with the input line and always visible. They can be resting (when a field is inactive and empty) or floating. The label is a text caption or description for the Text Field.
npm install @material/floating-label
<span class="mdc-floating-label" id="my-label-id">Hint text</span>
@use "@material/floating-label/mdc-floating-label";
import {MDCFloatingLabel} from '@material/floating-label';
const floatingLabel = new MDCFloatingLabel(document.querySelector('.mdc-floating-label'));
CSS Class | Description |
---|---|
mdc-floating-label | Mandatory. |
mdc-floating-label--float-above | Indicates the label is floating in the floating position. |
mdc-floating-label--shake | Shakes the label. |
mdc-floating-label--required | Indicates the label is required and adds an asterisk. |
Mixin | Description |
---|---|
ink-color($color) | Customizes the ink color of the label. |
fill-color($color) | Customizes the fill color of the label. |
shake-keyframes($modifier, $positionY, $positionX, $scale) | Generates a CSS @keyframes at-rule for an invalid label shake. Used in conjunction with the shake-animation mixin. |
shake-animation($modifier) | Applies shake keyframe animation to label. |
float-position($positionY, $positionX, $scale) | Sets position of label when floating. |
max-width($max-width) | Sets the max width of the label. |
float-transition($duration-ms, $timing-function) | Customizes the duration and optional timing function for the "float" transition. |
MDCFloatingLabel
Properties and MethodsMethod Signature | Description |
---|---|
shake(shouldShake: boolean) => void | Proxies to the foundation's shake() method. |
float(shouldFloat: boolean) => void | Proxies to the foundation's float() method. |
setRequired(isRequired: boolean) => void | Proxies to the foundation's setRequired() method. |
getWidth() => number | Proxies to the foundation's getWidth() method. |
If you are using a JavaScript framework, such as React or Angular, you can create a Floating Label 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.
MDCFloatingLabelAdapter
Method Signature | Description |
---|---|
addClass(className: string) => void | Adds a class to the label element. |
removeClass(className: string) => void | Removes a class from the label element. |
getWidth() => number | Returns the width of the label element. |
registerInteractionHandler(evtType: string, handler: EventListener) => void | Registers an event listener for a given event. |
deregisterInteractionHandler(evtType: string, handler: EventListener) => void | Deregisters an event listener for a given event. |
MDCFloatingLabelFoundation
Method Signature | Description |
---|---|
shake(shouldShake: boolean) | Shakes or stops shaking the label, depending on the value of shouldShake . |
float(shouldFloat: boolean) | Floats or docks the label, depending on the value of shouldFloat . |
setRequired(isRequired: boolean) | Styles the label as required, depending on the value of isRequired . |
getWidth() => number | Returns the width of the label element. |
FAQs
The Material Components for the web floating-label component
The npm package @material/floating-label receives a total of 754,623 weekly downloads. As such, @material/floating-label popularity was classified as popular.
We found that @material/floating-label demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 15 open source maintainers collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.