PXD

More Button

Styling component to show expanded or collapsed content.

Default

MoreButton extends the Button component.

<script setup>
import { ref } from 'vue'

const expanded = ref(false)
</script>

<template>
  <PMoreButton v-model="expanded" />
  <PMoreButton v-model="expanded" variant="primary" />
</template>

Texts

You can modify the button text by setting lessText and moreText.

<script setup>
import { ref } from 'vue'

const expanded = ref(false)
</script>

<template>
  <PMoreButton v-model="expanded" more-text="moreee" less-text="lessss" />
</template>

Props

NameTypeDefaultDescription
more-textstringShow MoreLabel rendered while the content is collapsed
less-textstringShow LessLabel rendered while the content is expanded
model-valuebooleanfalseExpanded state, toggled on every click

Events

NameTypeDescription
change(value: boolean) => voidEmitted when the button toggles the expanded state.
update:modelValue(value: boolean) => voidEmitted with the new expanded state on every toggle.

Source

Source