Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hypernym/nuxt-gsap

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hypernym/nuxt-gsap

GSAP module for Nuxt.

  • 2.4.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8K
increased by15.16%
Maintainers
0
Weekly downloads
 
Created
Source

Nuxt Gsap Module

GSAP module for Nuxt.

Features

  • Helps you integrate the GSAP animation library
  • Provides a solution for global use
  • Supports custom composables
  • Automatically registers plugins after activation
  • Allows you to easily register global effects & eases
  • Supports Club GreenSock premium plugins
  • Zero-config setup ready to go
  • TypeScript friendly
  • Super easy to use

Quick Start

  1. Install @hypernym/nuxt-gsap to your project
npm i -D @hypernym/nuxt-gsap
  1. Enable the module in the main config file
// nuxt.config.ts

{
  modules: ['@hypernym/nuxt-gsap']
}

That's it!

Module

The module comes with a zero-config setup so after activation it automatically adds the GSAP core and it is globally available without additional settings.

<!-- layout.vue | page.vue | component.vue -->

<template>
  <div>
    <h1 class="title">Nuxt Gsap</h1>
  </div>
</template>

<script setup lang="ts">
  const { $gsap } = useNuxtApp()

  onMounted(() => {
    $gsap.to('.title', { rotation: 3, x: 100, duration: 1 })
  })
</script>

Options

Nuxt Gsap Module is completely rewritten in TypeScript. It also improves the development experience with detailed descriptions, examples and code auto-completion.

After plugin activation, it is immediately available globally, so there is no need to manually import or register.

// nuxt.config.ts

{
  modules: ['@hypernym/nuxt-gsap'],

  gsap: {
    // Module options
  }
}

GSAP Core

It can be used via a provide helper that will be available globally or via a custom composable that you can import where you need it.

Provide

GSAP core is enabled by default on module activation.

// nuxt.config.ts

{
  modules: ['@hypernym/nuxt-gsap'],
}

Available globally

<script setup lang="ts">
  const { $gsap } = useNuxtApp()

  onMounted(() => {
    $gsap.to('.title', { rotation: 3, x: 100, duration: 1 })
  })
</script>

To disable the provide helper completely, set it to false.

// nuxt.config.ts

{
  gsap: {
    provide: false
  }
}

Composable

Imports the main gsap core as custom composable.

To enable custom composables, set it to true:

// nuxt.config.ts

{
  gsap: {
    composables: true
  }
}
useGsap
  • Custom composable
<!-- layout.vue | page.vue | component.vue -->

<template>
  <h1 class="title">Nuxt Gsap Module</h1>
</template>

<script setup lang="ts">
  useGsap.to('.title', { rotation: 3, x: 100, duration: 1 })
</script>
// Explicit import (optional)
import { useGsap } from '#gsap'

Documentation

Check the official docs for more info.

Community

Feel free to use the official discussions for any additional questions.

License

Gsap Platform

More details about GSAP licenses can be found in the official repository.

Nuxt Gsap Module

Developed in 🇭🇷 Croatia

Released under the MIT license.

© Hypernym Studio

Keywords

FAQs

Package last updated on 27 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc