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

@lion/progress-indicator

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lion/progress-indicator

A progress indicator that is easily styleable and accessible in all contexts

  • 0.2.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
282
increased by6.42%
Maintainers
1
Weekly downloads
 
Created
Source

Progress Indicator

lion-progress-indicator implements accessibility requirements for progress indicators.

import { html } from 'lit-html';
import './demo/custom-progress-indicator.js';

export default {
  title: 'Others/Progress Indicator',
};

Features

  • Accessibility compliant
  • Localized "Loading" label
  • Implementation independent of visuals

How to use

Installation

npm i --save @lion/progress-indicator
import { LionProgressIndicator } from '@lion/progress-indicator';
// or
import '@lion/progress-indicator/lion-progress-indicator.js';

Example

<lion-progress-indicator></lion-progress-indicator>

Extended indicator with a custom visual

LionProgressIndicator is designed to be extended to add visuals. Implement the _graphicTemplate method to set the rendered content, and apply styles normally.

Example extension

class CustomProgressIndicator extends LionProgressIndicator {
  static get styles() {
    return [
      css`
        svg {
          animation: spinner-rotate 2s linear infinite;
          display: inline-block;
          height: 48px;
          width: 48px;
        }

        circle {
          fill: none;
          stroke-width: 3.6;
          stroke: firebrick;
          stroke-dasharray: 100, 28;
        }

        @keyframes spinner-rotate {
          to {
            transform: rotate(360deg);
          }
        }
      `,
    ];
  }

  _graphicTemplate() {
    return html`<svg viewBox="22 22 44 44">
      <circle cx="44" cy="44" r="20.2" />
    </svg>`;
  }
}

Result

export const customProgressDemo = () => html`
  <custom-progress-indicator></custom-progress-indicator>
`;

Keywords

FAQs

Package last updated on 09 Nov 2020

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