0.1.0 • Published 5 years ago

@aybolit/material v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Aybolit Material

Aybolit Material is a set of the web components inspired by Material Design.

Overview

Aybolit Material is based on Matter, a library for creating Material Design Components in pure CSS. The reason to build on top of Matter is its custom CSS properties based architecture, which works with Web Components really nice.

The styles from Matter are preserved as much as possible, but the components variants and features, e.g. button types, should be configured via HTML attributes instead of CSS classes, in order to not affect the end user CSS.

Installation

Aybolit Material is available as npm package:

# with npm
npm i @aybolit/material --save

# with yarn
yarn add @aybolit/material

Import either all or individual components:

// all components
import '@aybolit/material';

// button only
import { AbmButton } from '@aybolit/material';

You can also use get Aybolit Material from the CDN:

<script src="https://unpkg.com/@aybolit/material@latest?module" type="module"></script>

Components

Examples

<!-- Buttons -->
<abm-button>Text</abm-button>
<abm-button theme="outlined">Outlined</abm-button>
<abm-button theme="contained">Contained</abm-button>

<!-- Checkbox -->
<abm-checkbox>Unchecked</abm-checkbox>
<abm-checkbox checked>Checked</abm-checkbox>
<abm-checkbox indeterminate>Indeterminate</abm-checkbox>

<!-- Progress (indeterminate) -->
<abm-progress></abm-progress>

<!-- Progress (determinate) -->
<abm-progress value="50" max="100"></abm-progress>

<!-- Range -->
<abm-range min="0" max="10" value="5"></abm-range>

<!-- Switch -->
<abm-switch>Unchecked</abm-switch>
<abm-switch checked>Checked</abm-switch>

Custom CSS Properties

The following custom CSS properties are available for styling.

PropertyDescription Fallback
--abm-primary-rgbPrimary color rgb value33, 150, 243
--abu-onprimary-rgbOn primary color rgb value255, 255, 255
--abu-surface-rgbSurface color rgb value255, 255, 255
--abu-onsurface-rgbOn surface color rgb value0, 0, 0