svelte-scrim
v0.1.0
Published
A vanilla JS scrim (backdrop) component made with Svelte.
Downloads
488
Maintainers
Readme
svelte-scrim
A vanilla JS scrim (backdrop) component made with Svelte.
install
$ npm install svelte-scrim
example
import Scrim from 'svelte-scrim'
const scrim = new Scrim({
target: document.body,
data: { // Scrim.DEFAULTS
opacity: 0.3,
background: '#000000'
}
})
API
See the svelte component API.
data
opacity
CSS opacity value
background
CSS background value
custom element
import 'svelte-scrim/element'
<svelte-scrim/>