# vue3-transition-expand

> This is a Vue 3 plugin to transition element to `height: auto;` based on [Markus Oberlehner article](https://markus.oberlehner.net/blog/transition-to-height-auto-with-vue/).

Latest version **1.2.0** (published 2023-06-26) · 0 weekly downloads

## Install

```sh
npm install vue3-transition-expand
pnpm add vue3-transition-expand
yarn add vue3-transition-expand
bun add vue3-transition-expand
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2023-06-26 |
| First published | 2023-02-01 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | mrleblanc101 |
| Keywords | vue, nuxt, transition, auto, height, expand, animation, component, slideToggle |

## Links

- npm: https://www.npmjs.com/package/vue3-transition-expand
- Repository: https://github.com/mrleblanc101/vue3-transition-expand
- Homepage: https://github.com/vuejs/core/tree/main/packages/vue#readme
- Issues: https://github.com/mrleblanc101/vue3-transition-expand/issues
- npm.io page: https://npm.io/package/vue3-transition-expand

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2023-06-26
- 1.1.1 — 2023-02-09
- 1.1.0 — 2023-02-02
- 1.0.2 — 2023-02-01
- 1.0.1 — 2023-02-01
- 1.0.0 — 2023-02-01

## README

# Vue Transition Expand

This is a Vue 3 plugin to transition element to `height: auto;` based on [Markus
Oberlehner article](https://markus.oberlehner.net/blog/transition-to-height-auto-with-vue/).

#### 👉 [Demo on StackBlitz](https://stackblitz.com/edit/vue-e9x3oe?file=src/App.vue)

## Installation

```bash
npm install vue3-transition-expand
# or
yarn add vue3-transition-expand
```

## Import

### Global import
```javascript
import TransitionExpand from 'vue3-transition-expand'

Vue.use(TransitionExpand, {
    // optional global options (see below)
})
```

### Local import

```js
import { TransitionExpand } from 'vue3-transition-expand';

export default {
    components: {
        TransitionExpand,
    },
    data () {
        return {
            expanded: false,
        };
    },
}
```

### Nuxt plugin
```js
import TransitionExpand from 'vue3-transition-expand';
import 'vue3-transition-expand/dist/style.css';

export default defineNuxtPlugin((nuxtApp) => {
    nuxtApp.vueApp.use(TransitionExpand, {
        // optional global options (see below)
    })
});
```

## Configuration

### Global Options
```ts
interface PluginOptions {
    componentName?: string; // default: 'TransitionExpand'
    duration?: number; // default: 300
    hwAcceleration?: boolean // default: false
}
```

### Component Props
```ts
export interface Props {
    expanded: boolean; // default: false
    duration?: number; // default: 300
    hwAcceleration?: boolean; // default: false
}
```

## Example

```html
<TransitionExpand :expanded="expanded">
    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. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</TransitionExpand>
<button @click="expanded = !expanded">{{ !expanded ? 'Expand' : 'Collapse' }}</button>
```

---
_Source: https://npm.io/package/vue3-transition-expand · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
