Socket
Socket
Sign inDemoInstall

@phemium-costaisa/accordion

Package Overview
Dependencies
81
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @phemium-costaisa/accordion

Accordion web component built with Stencil One.


Version published
Weekly downloads
28
decreased by-30%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Accordion Web Component

Installation

 npm i @phemium-costaisa/accordion

Usage

In your HTML files:

 <edmbn-accordion header-title="Title" expanded bordered>
    <div slot="content">
        <ul>
            <li>Item 1</li>
            <li>Item 2</li>
            <li>Item 3</li>
        </ul>
    </div>
 </edmbn-accordion>

Include attribute slot="content" to all the content that you want to be inside the accordion.

Javascript or AngularJS (1.x)

<script src="./plugins/edmbn-accordion.js"></script>

Angular 2+

Somewhere in your project (e.g. main.ts):

import { defineCustomElements as accordionLoader } from 'edmbn-accordion/loader';
accordionLoader(window);

React

On your index.js:

import { defineCustomElements as accordionLoader } from 'edmbn-accordion/loader';
accordionLoader(window);

Vue

import { defineCustomElements as accordionLoader } from 'edmbn-accordion/loader';
Vue.config.ignoredElements = [/test-\w*/];
accordionLoader(window);

Properties

PropertyDefaultDescription
header-titleSet the accordion header title.
expandedfalseSet the default position.
borderedfalseSet border top and bottom by default on header.
lost-focus-closefalseWhether to close accordion when loosing focus.
observe-contentfalseSet to true when content is dynamic.
debugfalseSet to true for debugging logs.

Slots

NameDescription
contentHTML Content to put inside accordion when unfolded
rightHTML Content to put in the right part of the header

Customize CSS

VariableDefault
--header-height50px
--header-background-colorwhite
--header-button-colorblack
--header-button-width1.5rem
--header-text-colorblack
--header-font-weight700
--header-font-size1rem
--header-border-topvar(--border-width) var(--border-style) var(--border-color)
--header-border-bottomvar(--border-width) var(--border-style) var(--border-color)
--header-border-leftnone
--header-border-rightnone
--border-stylesolid
--border-width1px
--border-color#ccc

Contribute

git clone https://github.com/phemium/accordion.git
cd accordion

and run:

npm install
npm start

To build the component for production, run:

npm run build

Keywords

FAQs

Last updated on 29 Jul 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc