1.0.1 • Published 4 years ago

svelte-preview-card v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Svelte-preview-card

Basic card presenting a title, sub-text, and background image ideally for a grid layout. Also has an event emitter for when it has been clicked.

Demo: http://linkcube.github.io/

Styling

This part is going to be fairly rough until I figure out a standard for themeing across my components, but for now it exposes raw color values for the text and background states.

Usage

let src = "my picture";
<PreviewCard
    background_source={src}
    primary_text="Title"
    sub_text="My Picture"
></PreviewCard>

Exposed Events:

EventDescription
on:openWhen the card is clicked

Optional settings:

ParamDescriptionType
background_sourceSource for the card's image, defaults to noneString
primary_text sub_textDisplayed text values, if these are not used the image max-height is increased.String
alt_textAlt text for the imageString
disabledWhether to disable the card from being clickedBoolean
background_color primary_text_color sub_text_colorBasic color valuesString
active_colorBackground color of the card when the mouse is held down on itString
focus_colorBackground color of the card if clickedString

Links

Github NPM