3.1.1 • Published 3 years ago

@orcden/od-cabinet v3.1.1

Weekly downloads
1
License
MIT
Repository
bitbucket
Last release
3 years ago

A component to house expanding content.

<od-cabinet> is a simple component that can control the behaviour of <od-cabinet-items>. The content expands into view and can be configured to only ever display one pice of content at a time.

Installation

  • Install with npm
npm i @orcden/od-cabinet

Usage

import '@orcden/od-cabinet';
<od-cabinet hold-open>
    <od-cabinet-item>
        <span slot='title'>Testing</span>
        <p>
            Test 1
        </p>
    </od-cabinet-item>

    <od-cabinet-item>
        <span slot='title'>Testing2</span>
        <p>
            Test 2
        </p>
    </od-cabinet-item>

    <od-cabinet-item>
        <span slot='title'>Testing3</span>
        <p>
            Test 3
        </p>
    </od-cabinet-item>
</od-cabinet>

Attributes

OD-Cabinet

AttributeTypeDefaultDescription
closedBooleantrueGet. You can set this to true to close all items. otherwise does nothing
hold-openBooleanfalseSet this to true so that the gallery doesn't automatically close other cabinet items

OD-Cabinet-Item

AttributeTypeDefaultDescription
openBooleanfalseUse this property to show or hide the content in the cabinet item

Properties

OD-Cabinet

AttributeTypeDefaultDescription
closedBooleantrueGet. You can set this to true to close all items. otherwise does nothing
holdOpenBooleanfalseSet this to true so that the gallery doesn't automatically close other cabinet items

OD-Cabinet-Item

AttributeTypeDefaultDescription
openBooleanfalseUse this property to show or hide the content in the cabinet item

Functions

OD-Cabinet

NameParametersDescription
closeItemsNoneCloses all the child cabinet items

OD-Cabinet-Item

NameParametersDescription
toggleOpenNoneCan be used to open and close the cabinet item content

Styling

  • CSS variables are available to alter the default styling provided

OD-Cabinet

Shadow PartsDescription
cabinetThe div used to house the cabinet items

OD-Cabinet-Item

Shadow PartsDescription
titleThe div used to house the title slot
sliding-containerA div used to transition the content. Change 'transition' to adjust timings
sliding-itemA div used to transition the content.
contentThe div used to house the actual cabinet item content.

Development

Run development server and show demo

npm run demo

Run linter

npm run lint

Fix linter errors

npm run fix

Run tests

npm run test

Build for production

npm run build
3.1.1

3 years ago

3.1.0

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.1

6 years ago

2.0.0

6 years ago