0.1.0 • Published 3 years ago

@power-elements/card v0.1.0

Weekly downloads
16
License
ISC
Repository
github
Last release
3 years ago

p-card

Example

<p-card>
  <h2 slot="heading">A card!</h2>
  <p>Has any content you want</p>
  <button slot="actions">As well as action buttons</button>
</p-card>

Properties

PropertyTypeDescription
collapsedbooleanIf the card is collapsible, whether or not it is collapsed
collapsiblebooleanWhether or not the card is collapsible
elevationnumberCard's elevation in the DOM tree

Methods

MethodTypeDescription
toggleCollapsed(): voidToggles the card's collapsed state.

Slots

NameDescription
Content Slot.
actionsActions Footer. Use a <menu>
headingHeading. Use an <hgroup> or <h1>, <h2>, etc.

CSS Shadow Parts

PartDescription
actionsActions container
contentContent container
headingHeading container

CSS Custom Properties

PropertyDefaultDescription
--elevation1elevation coefficient
--p-card-background-elevation1"#1111"background for 1st elevation cards
--p-card-background-elevation2"#2222"background for 2nd elevation cards
--p-card-border-radius"var(--p-card-border-radius-root, 16px) / var(--elevation, 1)"
--p-card-border-radius-root"16px"border-radius
--p-card-card-borderborder
--p-card-divider"var(--p-card-background-elevation1)"color of heading divider
--p-card-drop-shadow"0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)"box-shadow
--p-card-heading-background-color"initial"

p-card

Example

<p-card>
  <h2 slot="heading">A card!</h2>
  <p>Has any content you want</p>
  <button slot="actions">As well as action buttons</button>
</p-card>

Properties

PropertyAttributeTypeDefaultDescription
collapsedcollapsedbooleanfalseIf the card is collapsible, whether or not it is collapsed
collapsiblecollapsiblebooleanfalseWhether or not the card is collapsible
elevationelevationnumberCard's elevation in the DOM tree
onMutate
toggleCollapsed

Methods

MethodTypeDescription
toggleCollapsed(): voidToggles the card's collapsed state.

Slots

NameDescription
Content Slot.
actionsActions Footer. Use a <menu>
headingHeading. Use an <hgroup> or <h1>, <h2>, etc.

CSS Shadow Parts

PartDescription
actionsActions container
contentContent container
headingHeading container

CSS Custom Properties

PropertyDefaultDescription
--elevation1elevation coefficient
--p-card-background-elevation1"#1111"background for 1st elevation cards
--p-card-background-elevation2"#2222"background for 2nd elevation cards
--p-card-border-radius"var(--p-card-border-radius-root, 16px) / var(--elevation, 1)"
--p-card-border-radius-root"16px"border-radius
--p-card-card-borderborder
--p-card-divider"var(--p-card-background-elevation1)"color of heading divider
--p-card-drop-shadow"0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)"box-shadow
--p-card-heading-background-color"initial"