npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@limetech/mdc-notched-outline

v4.0.1-p4.0.0.1

Published

The Material Components for the web notched-outline component

Downloads

146

Readme

Notched Outline

The notched outline is a border around all sides of either a Text Field or Select component. This is used for the Outlined variant of either a Text Field or Select.

Design & API Documentation

Installation

npm install @limetech/mdc-notched-outline

Basic Usage

HTML Structure

<div class="mdc-notched-outline">
  <div class="mdc-notched-outline__leading"></div>
  <div class="mdc-notched-outline__notch">
    <label class="mdc-floating-label">Label</label>
  </div>
  <div class="mdc-notched-outline__trailing"></div>
</div>

Note that the MDC Floating Label component is placed inside the notch element when used together with MDC Notched Outline.

See the MDC Text Field and MDC Select documentation for information on using Notched Outline in the context of those components.

Styles

@import "@limetech/mdc-notched-outline/mdc-notched-outline";

JavaScript Instantiation

import {MDCNotchedOutline} from '@limetech/mdc-notched-outline';

const notchedOutline = new MDCNotchedOutline(document.querySelector('.mdc-notched-outline'));

See Importing the JS component for more information on how to import JavaScript.

Style Customization

CSS Classes

CSS Class | Description --- | --- mdc-notched-outline | Mandatory. Container for the outline's sides and notch. mdc-notched-outline--notched | Modifier class to open the notched outline. mdc-notched-outline--no-label | Modifier class to use when the floating label is empty or not used. mdc-notched-outline__leading | Mandatory. Element representing the leading side of the notched outline (before the notch). mdc-notched-outline__notch | Mandatory. Element representing the notch. mdc-notched-outline__trailing | Mandatory. Element representing the trailing side of the notched outline (after the notch).

Sass Mixins

Mixin | Description --- | --- mdc-notched-outline-color($color) | Customizes the border color of the notched outline. mdc-notched-outline-stroke-width($width) | Changes notched outline width to a specified pixel value. mdc-notched-outline-shape-radius($radius, $rtl-reflexive) | Sets the rounded shape to notched outline element with given radius size. Set $rtl-reflexive to true to flip radius values in RTL context, defaults to false. mdc-notched-outline-floating-label-float-position($positionY, $positionX, $scale) | Sets the position and scale of the floating label inside the notched outline.

MDCNotchedOutline Properties and Methods

Method Signature | Description --- | --- notch(notchWidth: number) => void | Opens the notch with the specified width. closeNotch() => void | Closes the notch, rendering a full outline.

Usage Within Frameworks

If you are using a JavaScript framework, such as React or Angular, you can create a Notched Outline 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.

MDCNotchedOutlineAdapter

Method Signature | Description --- | --- addClass(className: string) => void | Adds a class to the notched outline element. removeClass(className: string) => void | Removes a class from the notched outline element. setNotchWidthProperty(width: number) => void | Sets the width of the notch in pixels. removeNotchWidthProperty() => void | Removes the width property from the notch element.

MDCNotchedOutlineFoundation

Method Signature | Description --- | --- notch(notchWidth: number) => void | Adds the mdc-notched-outline--notched class and updates the notch element's style based on notchWidth. closeNotch() => void | Removes the mdc-notched-outline--notched class.