# Zipper pocket button

> A stitched denim pocket: on hover the brass pull runs along the zip and opens it to show the lining.

- Category: [Buttons](https://library.aimran.es/components/buttons)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-btn-zipper
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Denim texture, orange stitching and a brass zipper make this button feel like the back pocket of a pair of jeans. On hover or keyboard focus the pull slides across, its tab swings with inertia, and the zip opens into a V that reveals a satin lining with a small discount teaser. It is pure CSS, driven by an animated custom property. Great for fashion stores and sales.

The main color is the lining and the secondary color is the denim, so black jeans with a red lining or raw indigo with mustard are one tweak away. Keep the label short and uppercase, and edit the teaser on the lining to match your offer.

## Code

### HTML

```html
<button class="uvq01-zip" type="button"><span class="ln" aria-hidden="true"><b>-30%</b></span><span class="dn up" aria-hidden="true"><i></i></span><span class="dn dw" aria-hidden="true"><i></i></span><span class="tz" aria-hidden="true"></span><span class="pl" aria-hidden="true"></span><span class="t">See offer</span></button>
```

### CSS

```css
.uvq01-zip {
  --c1: #f08a24;
  --c2: #2f4a7a;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

@property --uvq01-zp {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.uvq01-zip {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.005em;
  white-space: nowrap;
  user-select: none;
  width: 15em;
  height: 4.6em;
  border-radius: .8em;
  overflow: hidden;
  --uvq01-zp: 0;
  --zx: calc(.9em + var(--uvq01-zp) * (100% - 1.8em));
  transition: --uvq01-zp calc(0.9s / var(--k)) cubic-bezier(.22,1,.36,1),transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 12px 24px -14px rgba(10,20,40,.7);
}

.uvq01-zip .ln {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg,rgba(255,255,255,.1) 0 .5em,transparent .5em 1em),linear-gradient(180deg,color-mix(in srgb,var(--c1) 75%,#fff),var(--c1) 40%,color-mix(in srgb,var(--c1) 70%,#000));
}

.uvq01-zip .ln b {
  position: absolute;
  left: 1.1em;
  top: 33%;
  translate: 0 -50%;
  font-size: .95em;
  font-weight: 900;
  letter-spacing: -.02em;
  color: #fff;
  text-shadow: 0 1px 0 color-mix(in srgb,var(--c1) 50%,#000);
}

.uvq01-zip .dn {
  position: absolute;
  inset: 0;
}

.uvq01-zip .up {
  filter: drop-shadow(0 .12em 0 #c99b45) drop-shadow(0 .3em .25em rgba(0,0,0,.45));
}

.uvq01-zip .dw {
  filter: drop-shadow(0 -.12em 0 #c99b45);
}

.uvq01-zip .dn i {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg,rgba(255,255,255,.07) 0 1px,transparent 1px 3px),repeating-linear-gradient(-45deg,rgba(0,0,0,.14) 0 1px,transparent 1px 4px),linear-gradient(180deg,color-mix(in srgb,var(--c2) 82%,#fff),var(--c2) 55%,color-mix(in srgb,var(--c2) 78%,#000));
}

.uvq01-zip .dn i::after {
  content: "";
  position: absolute;
  inset: .32em;
  border: .09em dashed #e9a13b;
  border-radius: .55em;
}

.uvq01-zip .up i {
  clip-path: polygon(0 0,100% 0,100% 34%,var(--zx) 34%,0 calc(34% - var(--uvq01-zp) * 30%));
}

.uvq01-zip .dw i {
  clip-path: polygon(0 calc(34% + var(--uvq01-zp) * 26%),var(--zx) 34%,100% 34%,100% 100%,0 100%);
}

.uvq01-zip .tz {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(34% - .27em);
  height: .54em;
  background: linear-gradient(180deg,rgba(255,255,255,.35),transparent 45%,rgba(0,0,0,.3)),repeating-linear-gradient(90deg,#d8b15a 0 .17em,transparent .17em .34em) 0 0/100% 50% no-repeat,repeating-linear-gradient(90deg,transparent 0 .17em,#c09440 .17em .34em) 0 100%/100% 50% no-repeat;
  clip-path: inset(0 0 0 var(--zx));
}

.uvq01-zip .pl {
  position: absolute;
  left: var(--zx);
  top: 34%;
  width: 1.2em;
  height: .9em;
  translate: -50% -50%;
  border-radius: .3em .3em .45em .45em;
  background: linear-gradient(180deg,#f3d48a,#c99b45 55%,#8d6a26);
  box-shadow: 0 .1em .2em rgba(0,0,0,.45);
}

.uvq01-zip .pl::after {
  content: "";
  position: absolute;
  left: 50%;
  top: .55em;
  width: .62em;
  height: 1.45em;
  translate: -50% 0;
  border-radius: .32em;
  background: radial-gradient(circle at 50% 74%,#3a3022 0 .12em,transparent .14em),linear-gradient(90deg,#b98a35,#f3d48a 45%,#a57a2c);
  box-shadow: 0 .12em .2em rgba(0,0,0,.4);
  transform-origin: 50% 0;
}

.uvq01-zip .t {
  position: absolute;
  left: 0;
  right: 0;
  bottom: .95em;
  text-align: center;
  font-size: .85em;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #f6ead0;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}

.uvq01-zip:hover,.uvq01-zip:focus-visible {
  --uvq01-zp: 1;
}

.uvq01-zip:hover .pl::after,.uvq01-zip:focus-visible .pl::after {
  animation: uvq01-zip-sw calc(1.1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-zip:active {
  transform: scale(.98);
}

.uvq01-zip:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq01-zip-sw {
  0% {
    transform: none;
  }
  20% {
    transform: rotate(30deg);
  }
  45% {
    transform: rotate(-16deg);
  }
  70% {
    transform: rotate(7deg);
  }
  100% {
    transform: none;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq01-zip,.uvq01-zip *,.uvq01-zip *::before,.uvq01-zip *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### React

```tsx
import type { CSSProperties } from "react";

const css = `
@property --uvq01-zp {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.uvq01-zip {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.005em;
  white-space: nowrap;
  user-select: none;
  width: 15em;
  height: 4.6em;
  border-radius: .8em;
  overflow: hidden;
  --uvq01-zp: 0;
  --zx: calc(.9em + var(--uvq01-zp) * (100% - 1.8em));
  transition: --uvq01-zp calc(0.9s / var(--k)) cubic-bezier(.22,1,.36,1),transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 12px 24px -14px rgba(10,20,40,.7);
}

.uvq01-zip .ln {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg,rgba(255,255,255,.1) 0 .5em,transparent .5em 1em),linear-gradient(180deg,color-mix(in srgb,var(--c1) 75%,#fff),var(--c1) 40%,color-mix(in srgb,var(--c1) 70%,#000));
}

.uvq01-zip .ln b {
  position: absolute;
  left: 1.1em;
  top: 33%;
  translate: 0 -50%;
  font-size: .95em;
  font-weight: 900;
  letter-spacing: -.02em;
  color: #fff;
  text-shadow: 0 1px 0 color-mix(in srgb,var(--c1) 50%,#000);
}

.uvq01-zip .dn {
  position: absolute;
  inset: 0;
}

.uvq01-zip .up {
  filter: drop-shadow(0 .12em 0 #c99b45) drop-shadow(0 .3em .25em rgba(0,0,0,.45));
}

.uvq01-zip .dw {
  filter: drop-shadow(0 -.12em 0 #c99b45);
}

.uvq01-zip .dn i {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg,rgba(255,255,255,.07) 0 1px,transparent 1px 3px),repeating-linear-gradient(-45deg,rgba(0,0,0,.14) 0 1px,transparent 1px 4px),linear-gradient(180deg,color-mix(in srgb,var(--c2) 82%,#fff),var(--c2) 55%,color-mix(in srgb,var(--c2) 78%,#000));
}

.uvq01-zip .dn i::after {
  content: "";
  position: absolute;
  inset: .32em;
  border: .09em dashed #e9a13b;
  border-radius: .55em;
}

.uvq01-zip .up i {
  clip-path: polygon(0 0,100% 0,100% 34%,var(--zx) 34%,0 calc(34% - var(--uvq01-zp) * 30%));
}

.uvq01-zip .dw i {
  clip-path: polygon(0 calc(34% + var(--uvq01-zp) * 26%),var(--zx) 34%,100% 34%,100% 100%,0 100%);
}

.uvq01-zip .tz {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(34% - .27em);
  height: .54em;
  background: linear-gradient(180deg,rgba(255,255,255,.35),transparent 45%,rgba(0,0,0,.3)),repeating-linear-gradient(90deg,#d8b15a 0 .17em,transparent .17em .34em) 0 0/100% 50% no-repeat,repeating-linear-gradient(90deg,transparent 0 .17em,#c09440 .17em .34em) 0 100%/100% 50% no-repeat;
  clip-path: inset(0 0 0 var(--zx));
}

.uvq01-zip .pl {
  position: absolute;
  left: var(--zx);
  top: 34%;
  width: 1.2em;
  height: .9em;
  translate: -50% -50%;
  border-radius: .3em .3em .45em .45em;
  background: linear-gradient(180deg,#f3d48a,#c99b45 55%,#8d6a26);
  box-shadow: 0 .1em .2em rgba(0,0,0,.45);
}

.uvq01-zip .pl::after {
  content: "";
  position: absolute;
  left: 50%;
  top: .55em;
  width: .62em;
  height: 1.45em;
  translate: -50% 0;
  border-radius: .32em;
  background: radial-gradient(circle at 50% 74%,#3a3022 0 .12em,transparent .14em),linear-gradient(90deg,#b98a35,#f3d48a 45%,#a57a2c);
  box-shadow: 0 .12em .2em rgba(0,0,0,.4);
  transform-origin: 50% 0;
}

.uvq01-zip .t {
  position: absolute;
  left: 0;
  right: 0;
  bottom: .95em;
  text-align: center;
  font-size: .85em;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #f6ead0;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}

.uvq01-zip:hover,.uvq01-zip:focus-visible {
  --uvq01-zp: 1;
}

.uvq01-zip:hover .pl::after,.uvq01-zip:focus-visible .pl::after {
  animation: uvq01-zip-sw calc(1.1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-zip:active {
  transform: scale(.98);
}

.uvq01-zip:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq01-zip-sw {
  0% {
    transform: none;
  }
  20% {
    transform: rotate(30deg);
  }
  45% {
    transform: rotate(-16deg);
  }
  70% {
    transform: rotate(7deg);
  }
  100% {
    transform: none;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq01-zip,.uvq01-zip *,.uvq01-zip *::before,.uvq01-zip *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

export default function BtnZipper() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#f08a24",
          "--c2": "#2f4a7a",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <button className="uvq01-zip" type="button"><span className="ln" aria-hidden="true"><b>-30%</b></span><span className="dn up" aria-hidden="true"><i></i></span><span className="dn dw" aria-hidden="true"><i></i></span><span className="tz" aria-hidden="true"></span><span className="pl" aria-hidden="true"></span><span className="t">See offer</span></button>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Zipper pocket button” block (Buttons) from AIMRAN Library to my project.

## What it is
A stitched denim pocket: on hover the brass pull runs along the zip and opens it to show the lining.

## Chosen settings
- Main color: #f08a24
- Secondary color: #2f4a7a
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Ver oferta"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
import type { CSSProperties } from "react";

const css = `
@property --uvq01-zp {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.uvq01-zip {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.005em;
  white-space: nowrap;
  user-select: none;
  width: 15em;
  height: 4.6em;
  border-radius: .8em;
  overflow: hidden;
  --uvq01-zp: 0;
  --zx: calc(.9em + var(--uvq01-zp) * (100% - 1.8em));
  transition: --uvq01-zp calc(0.9s / var(--k)) cubic-bezier(.22,1,.36,1),transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 12px 24px -14px rgba(10,20,40,.7);
}

.uvq01-zip .ln {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg,rgba(255,255,255,.1) 0 .5em,transparent .5em 1em),linear-gradient(180deg,color-mix(in srgb,var(--c1) 75%,#fff),var(--c1) 40%,color-mix(in srgb,var(--c1) 70%,#000));
}

.uvq01-zip .ln b {
  position: absolute;
  left: 1.1em;
  top: 33%;
  translate: 0 -50%;
  font-size: .95em;
  font-weight: 900;
  letter-spacing: -.02em;
  color: #fff;
  text-shadow: 0 1px 0 color-mix(in srgb,var(--c1) 50%,#000);
}

.uvq01-zip .dn {
  position: absolute;
  inset: 0;
}

.uvq01-zip .up {
  filter: drop-shadow(0 .12em 0 #c99b45) drop-shadow(0 .3em .25em rgba(0,0,0,.45));
}

.uvq01-zip .dw {
  filter: drop-shadow(0 -.12em 0 #c99b45);
}

.uvq01-zip .dn i {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg,rgba(255,255,255,.07) 0 1px,transparent 1px 3px),repeating-linear-gradient(-45deg,rgba(0,0,0,.14) 0 1px,transparent 1px 4px),linear-gradient(180deg,color-mix(in srgb,var(--c2) 82%,#fff),var(--c2) 55%,color-mix(in srgb,var(--c2) 78%,#000));
}

.uvq01-zip .dn i::after {
  content: "";
  position: absolute;
  inset: .32em;
  border: .09em dashed #e9a13b;
  border-radius: .55em;
}

.uvq01-zip .up i {
  clip-path: polygon(0 0,100% 0,100% 34%,var(--zx) 34%,0 calc(34% - var(--uvq01-zp) * 30%));
}

.uvq01-zip .dw i {
  clip-path: polygon(0 calc(34% + var(--uvq01-zp) * 26%),var(--zx) 34%,100% 34%,100% 100%,0 100%);
}

.uvq01-zip .tz {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(34% - .27em);
  height: .54em;
  background: linear-gradient(180deg,rgba(255,255,255,.35),transparent 45%,rgba(0,0,0,.3)),repeating-linear-gradient(90deg,#d8b15a 0 .17em,transparent .17em .34em) 0 0/100% 50% no-repeat,repeating-linear-gradient(90deg,transparent 0 .17em,#c09440 .17em .34em) 0 100%/100% 50% no-repeat;
  clip-path: inset(0 0 0 var(--zx));
}

.uvq01-zip .pl {
  position: absolute;
  left: var(--zx);
  top: 34%;
  width: 1.2em;
  height: .9em;
  translate: -50% -50%;
  border-radius: .3em .3em .45em .45em;
  background: linear-gradient(180deg,#f3d48a,#c99b45 55%,#8d6a26);
  box-shadow: 0 .1em .2em rgba(0,0,0,.45);
}

.uvq01-zip .pl::after {
  content: "";
  position: absolute;
  left: 50%;
  top: .55em;
  width: .62em;
  height: 1.45em;
  translate: -50% 0;
  border-radius: .32em;
  background: radial-gradient(circle at 50% 74%,#3a3022 0 .12em,transparent .14em),linear-gradient(90deg,#b98a35,#f3d48a 45%,#a57a2c);
  box-shadow: 0 .12em .2em rgba(0,0,0,.4);
  transform-origin: 50% 0;
}

.uvq01-zip .t {
  position: absolute;
  left: 0;
  right: 0;
  bottom: .95em;
  text-align: center;
  font-size: .85em;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #f6ead0;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}

.uvq01-zip:hover,.uvq01-zip:focus-visible {
  --uvq01-zp: 1;
}

.uvq01-zip:hover .pl::after,.uvq01-zip:focus-visible .pl::after {
  animation: uvq01-zip-sw calc(1.1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-zip:active {
  transform: scale(.98);
}

.uvq01-zip:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq01-zip-sw {
  0% {
    transform: none;
  }
  20% {
    transform: rotate(30deg);
  }
  45% {
    transform: rotate(-16deg);
  }
  70% {
    transform: rotate(7deg);
  }
  100% {
    transform: none;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq01-zip,.uvq01-zip *,.uvq01-zip *::before,.uvq01-zip *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

export default function BtnZipper() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#f08a24",
          "--c2": "#2f4a7a",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <button className="uvq01-zip" type="button"><span className="ln" aria-hidden="true"><b>-30%</b></span><span className="dn up" aria-hidden="true"><i></i></span><span className="dn dw" aria-hidden="true"><i></i></span><span className="tz" aria-hidden="true"></span><span className="pl" aria-hidden="true"></span><span className="t">See offer</span></button>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
