Skip to content

Library Shelf

Save button with book closing, sliding onto shelf, glowing, and bookmark animation

Library Shelf

by FreeCsStyles Dev's

AnimatedStorybook
🌐🎨⚛️💚🅰️🔥☁️
#library#book#shelf#save#bookmark#archive

Embed this component

Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/library-shelf.

<iframe src="/embed/library-shelf" sandbox="allow-scripts" loading="lazy" title="Library Shelf" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Library Shelf, or grab a framework-specific implementation. The HTML and CSS variants are self-contained; framework variants assume that framework's project setup.

HTML
<div class="library-container">
  <button class="library-button" onclick="saveToShelf()">
    <span class="book-icon">📚</span>
    <span class="button-text">Save</span>
    <div class="book"></div>
    <div class="shelf"></div>
    <div class="shelf-glow"></div>
    <div class="bookmark"></div>
  </button>
</div>
CSS
.library-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.library-button {
  position: relative;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #365314, #1a2e05);
  border: none;
  border-radius: 0.75rem;
  color: #ecfccb;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(54, 83, 20, 0.3);
}

.library-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(54, 83, 20, 0.4);
}

.book-icon {
  margin-right: 0.5rem;
  transition: transform 0.3s ease;
}

.book {
  position: absolute;
  top: 50%;
  left: 20%;
  transform: translate(-50%, -50%);
  width: 25px;
  height: 30px;
  background: linear-gradient(90deg, #dc2626, #991b1b);
  border-radius: 2px 4px 4px 2px;
  opacity: 0;
}

.library-button.animating .book {
  animation: book-close 0.5s ease-out forwards;
}

@keyframes book-close {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
}

.shelf {
  position: absolute;
  bottom: 15px;
  left: 10%;
  width: 80%;
  height: 8px;
  background: #78350f;
  border-radius: 2px;
  opacity: 0;
}

.library-button.animating .shelf {
  animation: shelf-appear 0.3s ease-out 0.5s forwards;
}

@keyframes shelf-appear {
  0% { opacity: 0; transform: scaleX(0); }
  100% { opacity: 1; transform: scaleX(1); }
}

.shelf-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.6), transparent);
  border-radius: 50%;
  opacity: 0;
}

.library-button.animating .shelf-glow {
  animation: shelf-glow 1s ease-in-out 1s forwards;
}

@keyframes shelf-glow {
  0% { width: 0; height: 0; opacity: 0; }
  50% { width: 60px; height: 60px; opacity: 1; }
  100% { width: 40px; height: 40px; opacity: 0.8; }
}

.bookmark {
  position: absolute;
  top: 10px;
  right: 20%;
  width: 10px;
  height: 20px;
  background: #f59e0b;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
  opacity: 0;
}

.library-button.animating .bookmark {
  animation: bookmark-appear 0.4s ease-out 1.5s forwards;
}

@keyframes bookmark-appear {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.library-button.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.library-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .library-button.animating * {
    animation: none !important;
  }
}
Tailwind CSS
<div class="flex justify-center items-center p-8">
  <button class="relative px-8 py-4 bg-gradient-to-r from-green-800 to-green-900 text-green-100 font-bold rounded-xl overflow-hidden transition-all hover:-translate-y-1 hover:shadow-lg hover:shadow-green-800/40 active:scale-95">
    <span class="mr-2">📚</span>
    <span>Save</span>
    <div class="absolute inset-0 pointer-events-none">
      <div class="absolute top-1/2 left-1/4 w-6 h-8 bg-gradient-to-r from-red-600 to-red-800 rounded-sm -translate-x-1/2 -translate-y-1/2 animate-book"></div>
      <div class="absolute bottom-4 left-1/4 right-1/4 h-2 bg-amber-800 rounded-sm scale-x-0 animate-shelf"></div>
      <div class="absolute top-1/2 left-1/2 w-16 h-16 bg-green-500/50 rounded-full -translate-x-1/2 -translate-y-1/2 scale-0 animate-glow"></div>
      <div class="absolute top-2 right-1/4 w-3 h-5 bg-amber-400 clip-bookmark animate-bookmark"></div>
    </div>
  </button>
</div>

<style>
@keyframes book {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
}
@keyframes shelf {
  0% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}
@keyframes glow {
  0% { transform: translate(-50%, -50%) scale(0); }
  50% { transform: translate(-50%, -50%) scale(1.5); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes bookmark {
  0% { transform: translateY(-10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.animate-book { animation: book 0.5s ease-out forwards; }
.animate-shelf { animation: shelf 0.3s ease-out 0.5s forwards; }
.animate-glow { animation: glow 1s ease-in-out 1s forwards; }
.animate-bookmark { animation: bookmark 0.4s ease-out 1.5s forwards; }
.clip-bookmark { clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
</style>
React
import { useState, useEffect } from 'react';

function LibraryShelfButton() {
  const [phase, setPhase] = useState('idle');
  
  const handleClick = () => {
    if (phase === 'animating') return;
    setPhase('animating');
    
    setTimeout(() => {
      setPhase('success');
      setTimeout(() => setPhase('idle'), 2000);
    }, 2000);
  };
  
  return (
    <>
      <style>{`
        .library-btn {
          position: relative;
          padding: 1rem 2rem;
          background: linear-gradient(135deg, #365314, #1a2e05);
          border: none;
          border-radius: 0.75rem;
          color: #ecfccb;
          font-weight: 700;
          cursor: pointer;
          overflow: hidden;
          transition: all 0.3s ease;
          box-shadow: 0 4px 15px rgba(54, 83, 20, 0.3);
        }
        .library-btn.animating {
          background: linear-gradient(135deg, #4d7c0f, #365314);
        }
        .library-btn.success {
          background: linear-gradient(135deg, #10b981, #059669);
          color: white;
        }
        .library-btn:hover:not(:disabled) {
          transform: translateY(-2px);
          box-shadow: 0 8px 25px rgba(54, 83, 20, 0.4);
        }
        .library-element {
          position: absolute;
          opacity: 0;
        }
        .book {
          top: 50%;
          left: 20%;
          width: 25px;
          height: 30px;
          background: linear-gradient(90deg, #dc2626, #991b1b);
          border-radius: 2px 4px 4px 2px;
          transform: translate(-50%, -50%) rotate(-10deg);
        }
        .shelf {
          bottom: 15px;
          left: 10%;
          width: 80%;
          height: 8px;
          background: #78350f;
          border-radius: 2px;
          transform: scaleX(0);
        }
        .shelf-glow {
          top: 50%;
          left: 50%;
          width: 0;
          height: 0;
          background: radial-gradient(circle, rgba(34, 197, 94, 0.6), transparent);
          border-radius: 50%;
          transform: translate(-50%, -50%);
        }
        .bookmark {
          top: 10px;
          right: 20%;
          width: 10px;
          height: 20px;
          background: #f59e0b;
          clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
          transform: translateY(-10px);
        }
        @keyframes bookClose {
          0% { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg); }
          100% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
        }
        @keyframes shelfAppear {
          0% { opacity: 0; transform: scaleX(0); }
          100% { opacity: 1; transform: scaleX(1); }
        }
        @keyframes shelfGlow {
          0% { width: 0; height: 0; opacity: 0; }
          50% { width: 60px; height: 60px; opacity: 1; }
          100% { width: 40px; height: 40px; opacity: 0.8; }
        }
        @keyframes bookmarkAppear {
          0% { opacity: 0; transform: translateY(-10px); }
          100% { opacity: 1; transform: translateY(0); }
        }
      `}</style>
      <button
        className={`library-btn ${phase}`}
        onClick={handleClick}
        disabled={phase === 'animating'}
      >
        <span className="mr-2">📚</span>
        <span>{phase === 'success' ? 'Saved!' : 'Save'}</span>
        {phase === 'animating' && (
          <>
            <div className="library-element book" style={{ animation: 'bookClose 0.5s ease-out forwards' }}></div>
            <div className="library-element shelf" style={{ animation: 'shelfAppear 0.3s ease-out 0.5s forwards' }}></div>
            <div className="library-element shelf-glow" style={{ animation: 'shelfGlow 1s ease-in-out 1s forwards' }}></div>
            <div className="library-element bookmark" style={{ animation: 'bookmarkAppear 0.4s ease-out 1.5s forwards' }}></div>
          </>
        )}
      </button>
    </>
  );
}

export default LibraryShelfButton;
Vue
<template>
  <div class="library-container">
    <button
      :class="['library-button', phase]"
      @click="handleClick"
      :disabled="phase === 'animating'"
    >
      <span class="book-icon">📚</span>
      <span class="button-text">{{ phase === 'success' ? 'Saved!' : 'Save' }}</span>
      <div v-if="phase === 'animating'" class="animation-elements">
        <div class="library-element book"></div>
        <div class="library-element shelf"></div>
        <div class="library-element shelf-glow"></div>
        <div class="library-element bookmark"></div>
      </div>
    </button>
  </div>
</template>

<script setup>
import { ref } from 'vue';

const phase = ref('idle');

const handleClick = () => {
  if (phase.value === 'animating') return;
  phase.value = 'animating';
  
  setTimeout(() => {
    phase.value = 'success';
    setTimeout(() => {
      phase.value = 'idle';
    }, 2000);
  }, 2000);
};
</script>

<style scoped>
.library-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.library-button {
  position: relative;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #365314, #1a2e05);
  border: none;
  border-radius: 0.75rem;
  color: #ecfccb;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(54, 83, 20, 0.3);
}

.library-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(54, 83, 20, 0.4);
}

.library-button.animating {
  background: linear-gradient(135deg, #4d7c0f, #365314);
}

.library-button.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.book-icon { margin-right: 0.5rem; }

.library-element { position: absolute; opacity: 0; }
.book { top: 50%; left: 20%; width: 25px; height: 30px; background: linear-gradient(90deg, #dc2626, #991b1b); border-radius: 2px 4px 4px 2px; transform: translate(-50%, -50%) rotate(-10deg); animation: bookClose 0.5s ease-out forwards; }
.shelf { bottom: 15px; left: 10%; width: 80%; height: 8px; background: #78350f; border-radius: 2px; transform: scaleX(0); animation: shelfAppear 0.3s ease-out 0.5s forwards; }
.shelf-glow { top: 50%; left: 50%; width: 0; height: 0; background: radial-gradient(circle, rgba(34, 197, 94, 0.6), transparent); border-radius: 50%; transform: translate(-50%, -50%); animation: shelfGlow 1s ease-in-out 1s forwards; }
.bookmark { top: 10px; right: 20%; width: 10px; height: 20px; background: #f59e0b; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); transform: translateY(-10px); animation: bookmarkAppear 0.4s ease-out 1.5s forwards; }

@keyframes bookClose { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg); } 100% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); } }
@keyframes shelfAppear { 0% { opacity: 0; transform: scaleX(0); } 100% { opacity: 1; transform: scaleX(1); } }
@keyframes shelfGlow { 0% { width: 0; height: 0; opacity: 0; } 50% { width: 60px; height: 60px; opacity: 1; } 100% { width: 40px; height: 40px; opacity: 0.8; } }
@keyframes bookmarkAppear { 0% { opacity: 0; transform: translateY(-10px); } 100% { opacity: 1; transform: translateY(0); } }

.library-button:disabled { opacity: 0.7; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .library-button.animating .library-element {
    animation: none !important;
  }
}
</style>
Svelte
<script>
  let phase = 'idle';
  
  function handleClick() {
    if (phase === 'animating') return;
    phase = 'animating';
    
    setTimeout(() => {
      phase = 'success';
      setTimeout(() => {
        phase = 'idle';
      }, 2000);
    }, 2000);
  }
</script>

<div class="library-container">
  <button class="library-button {phase}" on:click={handleClick} disabled={phase === 'animating'}>
    <span class="book-icon">📚</span>
    <span class="button-text">{phase === 'success' ? 'Saved!' : 'Save'}</span>
    {#if phase === 'animating'}
      <div class="library-element book"></div>
      <div class="library-element shelf"></div>
      <div class="library-element shelf-glow"></div>
      <div class="library-element bookmark"></div>
    {/if}
  </button>
</div>

<style>
  .library-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
  }
  .library-button {
    position: relative;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #365314, #1a2e05);
    border: none;
    border-radius: 0.75rem;
    color: #ecfccb;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(54, 83, 20, 0.3);
  }
  .library-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(54, 83, 20, 0.4);
  }
  .library-button.animating {
    background: linear-gradient(135deg, #4d7c0f, #365314);
  }
  .library-button.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
  }
  .book-icon { margin-right: 0.5rem; }
  .library-element { position: absolute; opacity: 0; }
  .book { top: 50%; left: 20%; width: 25px; height: 30px; background: linear-gradient(90deg, #dc2626, #991b1b); border-radius: 2px 4px 4px 2px; transform: translate(-50%, -50%) rotate(-10deg); animation: bookClose 0.5s ease-out forwards; }
  .shelf { bottom: 15px; left: 10%; width: 80%; height: 8px; background: #78350f; border-radius: 2px; transform: scaleX(0); animation: shelfAppear 0.3s ease-out 0.5s forwards; }
  .shelf-glow { top: 50%; left: 50%; width: 0; height: 0; background: radial-gradient(circle, rgba(34, 197, 94, 0.6), transparent); border-radius: 50%; transform: translate(-50%, -50%); animation: shelfGlow 1s ease-in-out 1s forwards; }
  .bookmark { top: 10px; right: 20%; width: 10px; height: 20px; background: #f59e0b; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); transform: translateY(-10px); animation: bookmarkAppear 0.4s ease-out 1.5s forwards; }
  @keyframes bookClose { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg); } 100% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); } }
  @keyframes shelfAppear { 0% { opacity: 0; transform: scaleX(0); } 100% { opacity: 1; transform: scaleX(1); } }
  @keyframes shelfGlow { 0% { width: 0; height: 0; opacity: 0; } 50% { width: 60px; height: 60px; opacity: 1; } 100% { width: 40px; height: 40px; opacity: 0.8; } }
  @keyframes bookmarkAppear { 0% { opacity: 0; transform: translateY(-10px); } 100% { opacity: 1; transform: translateY(0); } }
  .library-button:disabled { opacity: 0.7; cursor: not-allowed; }
  @media (prefers-reduced-motion: reduce) { .library-button.animating .library-element { animation: none !important; } }
</style>
Angular
import { Component } from '@angular/core';

@Component({
  selector: 'app-library-shelf-button',
  template: `
    <div class="library-container">
      <button
        [class]="'library-button ' + phase"
        (click)="handleClick()"
        [disabled]="phase === 'animating'"
      >
        <span class="book-icon">📚</span>
        <span class="button-text">{{ phase === 'success' ? 'Saved!' : 'Save' }}</span>
        <div *ngIf="phase === 'animating'" class="animation-elements">
          <div class="library-element book"></div>
          <div class="library-element shelf"></div>
          <div class="library-element shelf-glow"></div>
          <div class="library-element bookmark"></div>
        </div>
      </button>
    </div>
  `,
  styles: [`
    .library-container {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 2rem;
    }
    .library-button {
      position: relative;
      padding: 1rem 2rem;
      background: linear-gradient(135deg, #365314, #1a2e05);
      border: none;
      border-radius: 0.75rem;
      color: #ecfccb;
      font-weight: 700;
      cursor: pointer;
      overflow: hidden;
      transition: all 0.3s ease;
      box-shadow: 0 4px 15px rgba(54, 83, 20, 0.3);
    }
    .library-button:hover:not(:disabled) {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(54, 83, 20, 0.4);
    }
    .library-button.animating {
      background: linear-gradient(135deg, #4d7c0f, #365314);
    }
    .library-button.success {
      background: linear-gradient(135deg, #10b981, #059669);
      color: white;
    }
    .book-icon { margin-right: 0.5rem; }
    .library-element { position: absolute; opacity: 0; }
    .book { top: 50%; left: 20%; width: 25px; height: 30px; background: linear-gradient(90deg, #dc2626, #991b1b); border-radius: 2px 4px 4px 2px; transform: translate(-50%, -50%) rotate(-10deg); animation: bookClose 0.5s ease-out forwards; }
    .shelf { bottom: 15px; left: 10%; width: 80%; height: 8px; background: #78350f; border-radius: 2px; transform: scaleX(0); animation: shelfAppear 0.3s ease-out 0.5s forwards; }
    .shelf-glow { top: 50%; left: 50%; width: 0; height: 0; background: radial-gradient(circle, rgba(34, 197, 94, 0.6), transparent); border-radius: 50%; transform: translate(-50%, -50%); animation: shelfGlow 1s ease-in-out 1s forwards; }
    .bookmark { top: 10px; right: 20%; width: 10px; height: 20px; background: #f59e0b; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); transform: translateY(-10px); animation: bookmarkAppear 0.4s ease-out 1.5s forwards; }
    @keyframes bookClose { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg); } 100% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); } }
    @keyframes shelfAppear { 0% { opacity: 0; transform: scaleX(0); } 100% { opacity: 1; transform: scaleX(1); } }
    @keyframes shelfGlow { 0% { width: 0; height: 0; opacity: 0; } 50% { width: 60px; height: 60px; opacity: 1; } 100% { width: 40px; height: 40px; opacity: 0.8; } }
    @keyframes bookmarkAppear { 0% { opacity: 0; transform: translateY(-10px); } 100% { opacity: 1; transform: translateY(0); } }
    .library-button:disabled { opacity: 0.7; cursor: not-allowed; }
    @media (prefers-reduced-motion: reduce) { .library-button.animating .library-element { animation: none !important; } }
  `]
})
export class LibraryShelfButtonComponent {
  phase = 'idle';

  handleClick(): void {
    if (this.phase === 'animating') return;
    this.phase = 'animating';
    
    setTimeout(() => {
      this.phase = 'success';
      setTimeout(() => {
        this.phase = 'idle';
      }, 2000);
    }, 2000);
  }
}
LWC — HTML template
<template>
  <div class="library-container">
    <button class="library-button {buttonClass}" onclick={handleClick} disabled={isAnimating}>
      <span class="book-icon">📚</span>
      <span class="button-text">{buttonText}</span>
      <template if:true={isAnimating}>
        <div class="library-element book"></div>
        <div class="library-element shelf"></div>
        <div class="library-element shelf-glow"></div>
        <div class="library-element bookmark"></div>
      </template>
    </button>
  </div>
</template>
LWC — JavaScript
import { LightningElement, api } from 'lwc';

export default class LibraryShelfButton extends LightningElement {
  @api label = 'Save';
  phase = 'idle';
  
  get isAnimating() {
    return this.phase === 'animating';
  }
  
  get buttonText() {
    return this.phase === 'success' ? 'Saved!' : this.label;
  }
  
  get buttonClass() {
    return `library-button ${this.phase}`;
  }
  
  handleClick() {
    if (this.phase === 'animating') return;
    this.phase = 'animating';
    
    setTimeout(() => {
      this.phase = 'success';
      setTimeout(() => {
        this.phase = 'idle';
      }, 2000);
    }, 2000);
  }
}
LWC — CSS
.library-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.library-button {
  position: relative;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #365314, #1a2e05);
  border: none;
  border-radius: 0.75rem;
  color: #ecfccb;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(54, 83, 20, 0.3);
}

.library-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(54, 83, 20, 0.4);
}

.library-button.animating {
  background: linear-gradient(135deg, #4d7c0f, #365314);
}

.library-button.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.book-icon { margin-right: 0.5rem; }
.library-element { position: absolute; opacity: 0; }
.book { top: 50%; left: 20%; width: 25px; height: 30px; background: linear-gradient(90deg, #dc2626, #991b1b); border-radius: 2px 4px 4px 2px; transform: translate(-50%, -50%) rotate(-10deg); animation: bookClose 0.5s ease-out forwards; }
.shelf { bottom: 15px; left: 10%; width: 80%; height: 8px; background: #78350f; border-radius: 2px; transform: scaleX(0); animation: shelfAppear 0.3s ease-out 0.5s forwards; }
.shelf-glow { top: 50%; left: 50%; width: 0; height: 0; background: radial-gradient(circle, rgba(34, 197, 94, 0.6), transparent); border-radius: 50%; transform: translate(-50%, -50%); animation: shelfGlow 1s ease-in-out 1s forwards; }
.bookmark { top: 10px; right: 20%; width: 10px; height: 20px; background: #f59e0b; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); transform: translateY(-10px); animation: bookmarkAppear 0.4s ease-out 1.5s forwards; }
@keyframes bookClose { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg); } 100% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); } }
@keyframes shelfAppear { 0% { opacity: 0; transform: scaleX(0); } 100% { opacity: 1; transform: scaleX(1); } }
@keyframes shelfGlow { 0% { width: 0; height: 0; opacity: 0; } 50% { width: 60px; height: 60px; opacity: 1; } 100% { width: 40px; height: 40px; opacity: 0.8; } }
@keyframes bookmarkAppear { 0% { opacity: 0; transform: translateY(-10px); } 100% { opacity: 1; transform: translateY(0); } }
.library-button:disabled { opacity: 0.7; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .library-button.animating .library-element { animation: none !important; } }
LWC — Configuration
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
  <apiVersion>59.0</apiVersion>
  <isExposed>true</isExposed>
  <targets>
    <target>lightning__AppPage</target>
    <target>lightning__RecordPage</target>
    <target>lightning__HomePage</target>
  </targets>
</LightningComponentBundle>

Where Library Shelf fits

  • Save documents
  • Bookmark articles
  • Archive content
  • Library management

Interaction states & animations

  • Book Close
  • Slide
  • Shelf Glow
  • Bookmark
  • Complete

Topics

  • #library
  • #book
  • #shelf
  • #save
  • #bookmark
  • #archive

Accessibility notes

Animation is decorative. Button text remains readable. Respect reduced-motion preference.

Browser support

  • All modern browsers