MazExpandAnimation
MazExpandAnimation is a standalone component that allows you to animate the height of a block element
INFO
Before you have to import the global css files in your project, follow instructions in Getting Started
Basic usage
Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
vue
<template>
<MazBtn @click="visible = !visible"> Exec animation </MazBtn>
<MazExpandAnimation v-model="visible">
Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</MazExpandAnimation>
</template>
<script lang="ts" setup>
import MazExpandAnimation from 'maz-ui/components/MazExpandAnimation'
import { ref } from 'vue'
const visible = ref(false)
</script>
Options
- duration:
String
- default:300ms
- Duration of the animation in ms - timing-function:
String
- default:ease-in-out
- Timing function of the animation
Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
vue
<template>
<MazBtn @click="visible = !visible"> Exec animation </MazBtn>
<MazExpandAnimation v-model="visible" duration="1000ms" timing-function="linear">
Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</MazExpandAnimation>
</template>
<script lang="ts" setup>
import MazExpandAnimation from 'maz-ui/components/MazExpandAnimation'
import { ref } from 'vue'
const visible = ref(false)
</script>
Props & Slots
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
duration | Duration of the animation in milliseconds@default '300ms' | string | - | '300ms' |
timingFunction | Timing function of the animation@default 'ease-in-out' | string | - | 'ease-in-out' |
Slots
Name | Description | Bindings |
---|---|---|
default | Default Slot - Display content |