New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

alpine-view-transitions

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alpine-view-transitions

Alpine.js extension for the View Transition API

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
0
Created
Source

Alpine View Transitions

An Alpine.js plugin that adds CSS View Transitions support to your Alpine applications.

Installation

npm install alpine-view-transitions

Usage

import Alpine from 'alpinejs'
import ViewTransitions from 'alpine-view-transitions'

Alpine.plugin(ViewTransitions)
Alpine.start()

Basic Usage

Add a View Transition

This will add a utility class and it will transition with the default cross-fade effect.

<button x-view-transition="rotate-45">
    Click me
</button>

Just set a transition name

Give the transition a unique name. The transition will now become a lot smoother.

<span x-view-transition:button-text>
    Button text
</span>

Dynamic Expressions

<button
    x-data="{ isOpen: false }"
    x-on:click="isOpen = ! isOpen"
    x-view-transition:button="isOpen ? 'w-full' : 'w-1/2'"
>
    Toggle
</button>

Custom CSS Animations

If you want to animate the transitions differently, you will have to add your own custom CSS. Learn more about how to do this here

Keywords

alpine

FAQs

Package last updated on 29 Jan 2025

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