1.0.0 • Published 3 years ago

@shapla/vue-toggles v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Shapla Toggles

A simple accordion/toggle component for Vue 3

Table of contents

Installation

npm install --save @shapla/vue-toggles

Usage

Add the component:

import {ShaplaToggles, ShaplaToggle} from '@shapla/vue-toggles';

export default {
  name: 'Hello',
  components: {ShaplaToggles, ShaplaToggle}
}
<shapla-toggles>
  <shapla-toggle name="Toggle One" :selected="true">
    <!-- content -->
  </shapla-toggle>
  <shapla-toggle name="Toggle Two">
    <!-- content -->
  </shapla-toggle>
</shapla-toggles>

Props for ShaplaToggles

PropertyTypeRequiredDefaultDescription
accordionBooleannotrueIf you set false. All toggle components can be opened. Otherwise opening one will close another.
iconPositionStringnoleftValue can be left or right.
boxedModeBooleannotrueSet false if you don't want border on all side.
showDividerBooleannotrueOnly works when boxedMode is false. Remove all borders.

Props for ShaplaToggle

PropertyTypeRequiredDefaultDescription
nameStringyestrueToggle title.
subtextStringyestrueToggle subtitle.
selectedBooleannofalseSet true if you to keep open by default.