Deadline-Based Fading
Set a specific date/time for complete fade-out. VanisherJS automatically calculates and applies opacity based on time remaining.
Gradually reduce opacity over time until a specified deadline. Perfect for unpaid invoices, expiring offers, or time-sensitive content.
<div id="vanisher-element">This element will fade out by the deadline</div>
import { createVanisher } from "vanisher";
const vanisher = createVanisher({
deadline: "2025-01-01T23:59:59",
targetElement: "#vanisher-element",
});
import { VanisherReactWrapper } from "vanisher/react";
function App() {
return (
<VanisherReactWrapper deadline="2025-01-01T23:59:59">
<h1>This content will fade out by January 1st, 2025</h1>
</VanisherReactWrapper>
);
}
import { VanisherNextWrapper } from "vanisher/next";
export default function Page() {
return (
<VanisherNextWrapper
deadline="2025-01-01T23:59:59"
fallback={<div>Content has expired</div>}
>
<h1>Next.js optimized fading content</h1>
</VanisherNextWrapper>
);
}
VanisherJS is a powerful JavaScript library that automatically fades out websites and elements based on time deadlines. It's designed to be simple to use while providing powerful customization options for various use cases.
// Core functionality
import { createVanisher, Vanisher } from 'vanisher';
// React components
import { VanisherReactWrapper } from 'vanisher/react';
// Next.js components
import { VanisherNextWrapper } from 'vanisher/next';
// TypeScript types
import type { VanisherOptions, VanisherResult } from 'vanisher';
"VanisherJS: Fade out by deadline"