Back to FAQ-guidelines

JavaScriptThe latest version of this package is: 0.17.3, Opens in new window

JavaScript library for the FAQ Component

This component is compatible with ESM (ES6 module) and IIFE. See documentation examples below.

To be able to install this component, please refer to the Project Setup documentation.

$ npm i @ids-js/faq@0.17.3

Table of Contents

Usage

To initialize follow these steps:

Add markup

<div class="if faqs">
  <details class="if faq">
    <summary class="if question">Vem gäller hemförsäkringen för?</summary>
    <div class="if answer">
      <content>
    </div>
  </details>
  <details class="if faq"></details></div>

Add JavaScript

By script tag

<script src="/faq.iife.js"></script>
<script>
  IDSFaq.faq();
</script>

As an ES6 module

import { faq as IDSFaq } from '@if-design-system/faq-js';

IDSFaq();
Contact us, Opens in new window