# Event ticket card

> A ticket-shaped card with a perforated stub that pulls slightly away when you hover it.

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

## Where to use it

When a plain card feels too generic for an event, a ticket says it at a glance. Use it for the confirmation page of a design talk or the “My tickets” screen of a festival app. This ticket card in HTML and CSS has side notches, a dashed tear line and room for the time and the gate.

The side notches take the page background color, so place the card on a flat background, not over a photo or a gradient. Keep the stub for two short facts at most, like time and door; anything longer wraps and breaks the ticket look.

## Code

### HTML

```html
<article class="uv-cticket"><div><small>12 OCT · MADRID</small><h3>Design nights</h3><p>A conversation about ideas, product, and visual culture.</p></div><aside><b>20:30</b><span>Gate 04</span><i>⌁</i></aside></article>
```

### CSS

```css
.uv-cticket {
  --c1: #0071e3;
  --c2: #8ec5ff;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uv-cticket {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  display: grid;
  grid-template-columns: 1fr 5.2em;
  width: 19em;
  min-height: 11em;
  overflow: hidden;
  border-radius: 1.5em;
  font-size: var(--s);
  color: #fff;
  background: linear-gradient(145deg,color-mix(in srgb,var(--c1) 85%,#000),color-mix(in srgb,var(--c2) 60%,#000));
  box-shadow: 0 24px 50px -25px var(--c1);
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uv-cticket>div {
  padding: 1.35em;
}

.uv-cticket small {
  font-size: .62em;
  opacity: .65;
}

.uv-cticket h3 {
  margin: 1.4em 0 .4em;
  font-size: 1.35em;
}

.uv-cticket p {
  margin: 0;
  font-size: .72em;
  line-height: 1.45;
  opacity: .7;
}

.uv-cticket aside {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3em;
  border-left: 1px dashed rgba(255,255,255,.45);
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uv-cticket aside::before,.uv-cticket aside::after {
  content: "";
  position: absolute;
  left: -.65em;
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  background: var(--bg);
}

.uv-cticket aside::before {
  top: -.65em;
}

.uv-cticket aside::after {
  bottom: -.65em;
}

.uv-cticket aside b {
  font-size: 1.1em;
}

.uv-cticket aside span {
  font-size: .6em;
  opacity: .65;
}

.uv-cticket aside i {
  margin-top: 1em;
  font-size: 1.5em;
  font-style: normal;
}

.uv-cticket:hover {
  transform: rotate(-1deg) translateY(-4px);
}

.uv-cticket:hover aside {
  transform: translateX(.18em);
}
```

### React

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

const css = `
.uv-cticket {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  display: grid;
  grid-template-columns: 1fr 5.2em;
  width: 19em;
  min-height: 11em;
  overflow: hidden;
  border-radius: 1.5em;
  font-size: var(--s);
  color: #fff;
  background: linear-gradient(145deg,color-mix(in srgb,var(--c1) 85%,#000),color-mix(in srgb,var(--c2) 60%,#000));
  box-shadow: 0 24px 50px -25px var(--c1);
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uv-cticket>div {
  padding: 1.35em;
}

.uv-cticket small {
  font-size: .62em;
  opacity: .65;
}

.uv-cticket h3 {
  margin: 1.4em 0 .4em;
  font-size: 1.35em;
}

.uv-cticket p {
  margin: 0;
  font-size: .72em;
  line-height: 1.45;
  opacity: .7;
}

.uv-cticket aside {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3em;
  border-left: 1px dashed rgba(255,255,255,.45);
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uv-cticket aside::before,.uv-cticket aside::after {
  content: "";
  position: absolute;
  left: -.65em;
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  background: var(--bg);
}

.uv-cticket aside::before {
  top: -.65em;
}

.uv-cticket aside::after {
  bottom: -.65em;
}

.uv-cticket aside b {
  font-size: 1.1em;
}

.uv-cticket aside span {
  font-size: .6em;
  opacity: .65;
}

.uv-cticket aside i {
  margin-top: 1em;
  font-size: 1.5em;
  font-style: normal;
}

.uv-cticket:hover {
  transform: rotate(-1deg) translateY(-4px);
}

.uv-cticket:hover aside {
  transform: translateX(.18em);
}
`;

export default function CardTicket() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#0071e3",
          "--c2": "#8ec5ff",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <article className="uv-cticket"><div><small>12 OCT · MADRID</small><h3>Design nights</h3><p>A conversation about ideas, product, and visual culture.</p></div><aside><b>20:30</b><span>Gate 04</span><i>⌁</i></aside></article>
      </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 “Event ticket card” block (Cards) from AIMRAN Library to my project.

## What it is
A ticket-shaped card with a perforated stub that pulls slightly away when you hover it.

## Chosen settings
- Main color: #0071e3
- Secondary color: #8ec5ff
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Design nights"

## 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 = `
.uv-cticket {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  display: grid;
  grid-template-columns: 1fr 5.2em;
  width: 19em;
  min-height: 11em;
  overflow: hidden;
  border-radius: 1.5em;
  font-size: var(--s);
  color: #fff;
  background: linear-gradient(145deg,color-mix(in srgb,var(--c1) 85%,#000),color-mix(in srgb,var(--c2) 60%,#000));
  box-shadow: 0 24px 50px -25px var(--c1);
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uv-cticket>div {
  padding: 1.35em;
}

.uv-cticket small {
  font-size: .62em;
  opacity: .65;
}

.uv-cticket h3 {
  margin: 1.4em 0 .4em;
  font-size: 1.35em;
}

.uv-cticket p {
  margin: 0;
  font-size: .72em;
  line-height: 1.45;
  opacity: .7;
}

.uv-cticket aside {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3em;
  border-left: 1px dashed rgba(255,255,255,.45);
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uv-cticket aside::before,.uv-cticket aside::after {
  content: "";
  position: absolute;
  left: -.65em;
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  background: var(--bg);
}

.uv-cticket aside::before {
  top: -.65em;
}

.uv-cticket aside::after {
  bottom: -.65em;
}

.uv-cticket aside b {
  font-size: 1.1em;
}

.uv-cticket aside span {
  font-size: .6em;
  opacity: .65;
}

.uv-cticket aside i {
  margin-top: 1em;
  font-size: 1.5em;
  font-style: normal;
}

.uv-cticket:hover {
  transform: rotate(-1deg) translateY(-4px);
}

.uv-cticket:hover aside {
  transform: translateX(.18em);
}
`;

export default function CardTicket() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#0071e3",
          "--c2": "#8ec5ff",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <article className="uv-cticket"><div><small>12 OCT · MADRID</small><h3>Design nights</h3><p>A conversation about ideas, product, and visual culture.</p></div><aside><b>20:30</b><span>Gate 04</span><i>⌁</i></aside></article>
      </div>
    </>
  );
}
```

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