![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@material/floating-label
Advanced tools
Readme
Floating labels display the type of input a field requires. Every text field and select should have a label. 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.
<label class="mdc-floating-label" for="my-text-field-id">Hint text</label>
mdc-text-field
<div class="mdc-text-field">
<input type="text" id="my-text-field-id" class="mdc-text-field__input">
<label class="mdc-floating-label" for="my-text-field-id">Hint text</label>
<div class="mdc-text-field__bottom-line"></div>
</div>
If you're using the JavaScript-enabled version of floating label, you can avoid needing to assign
a unique id
to each <input>
by wrapping mdc-text-field__input
within a <label>
:
<label class="mdc-text-field">
<input type="text" class="mdc-text-field__input">
<span class="mdc-floating-label">Hint Text</span>
<div class="mdc-text-field__bottom-line"></div>
</label>
CSS Class | Description |
---|---|
mdc-floating-label | Mandatory. |
mdc-floating-label--float-above | Indicates the label is floating above the text field. |
mdc-floating-label--shake | Shakes the label. |
Mixin | Description |
---|---|
mdc-floating-label-ink-color($color) | Customizes the ink color of the label. |
mdc-floating-label-fill-color($color) | Customizes the fill color of the label. |
mdc-floating-label-shake-keyframes($modifier, $positionY, $positionX, $scale) | Generates a CSS @keyframes at-rule for an invalid label shake. Used in conjunction with the mdc-floating-label-shake-animation mixin. |
mdc-floating-label-shake-animation($modifier) | Applies shake keyframe animation to label. |
mdc-floating-label-float-position($positionY, $positionX, $scale) | Sets position of label when floating. |
MDCFloatingLabel
Method Signature | Description |
---|---|
shake(shouldShake: boolean) => void | Shakes or stops shaking the label, depending on the value of shouldShake . Proxies to the foundation method of the same name. |
float(shouldFloat: boolean) => void | Floats or docks the label, depending on the value of shouldFloat . Proxies to the foundation method of the same name. |
getWidth() => number | Returns the width of the label element. |
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. |
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 . |
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 822,321 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.