Skip to content
animorio
IT
Back to the library

Database schema

SVG, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.0 KBGSAP 28 KBFreeDownload the zip

A database schema, in a card on warm white, minimal style: three tables with their fields, joined by threads ending in a bar on the one side and a crow’s foot on the many. Pointing at a table turns its border and header green, the threads to the tables it is tied to redraw themselves with dashes running along them from the one to the many, the keys at both ends light up and the line below says the relation in words.

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.

<!doctype html>
<!--
  "Database schema" from Animorio · https://animorio.com
  License: free on your own sites and your clients’ sites, paid work included.
  Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Database schema</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- a database schema: three tables with their fields, joined by their relations. Pointing at a table lights
         its keys, redraws the threads to the tables it is tied to and says the relation in words -->
    <section class="sd" data-sd aria-label="Database schema">
      <header class="sd__head"><strong>Schema</strong><span>shop_db</span></header>
      <div class="sd__board" data-board>
        <svg class="sd__wires" data-wires aria-hidden="true"></svg>
        <button type="button" class="sd__t sd__t--users" data-table="0" aria-label="Table users"><strong>users</strong><ul><li data-end="users.id"><span class="sd__mark"><svg viewBox="0 0 12 12" aria-hidden="true"><circle cx="4" cy="6" r="2.300"></circle><path d="M6.300 6h4.200M8.800 6v2M10.500 6v1.400"></path></svg></span><b>id</b><i>int</i></li><li><span class="sd__mark"></span><b>name</b><i>text</i></li><li><span class="sd__mark"></span><b>email</b><i>text</i></li></ul></button>
        <button type="button" class="sd__t sd__t--orders" data-table="1" aria-label="Table orders"><strong>orders</strong><ul><li data-end="orders.id"><span class="sd__mark"><svg viewBox="0 0 12 12" aria-hidden="true"><circle cx="4" cy="6" r="2.300"></circle><path d="M6.300 6h4.200M8.800 6v2M10.500 6v1.400"></path></svg></span><b>id</b><i>int</i></li><li data-end="orders.user_id"><span class="sd__mark"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M5 7 7 5M4.300 5.200 3.200 6.300a1.800 1.800 0 0 0 2.500 2.500l1.100-1.100M7.700 6.800l1.100-1.100a1.800 1.800 0 0 0-2.500-2.500L5.200 4.300"></path></svg></span><b>user_id</b><i>int</i></li><li><span class="sd__mark"></span><b>total</b><i>money</i></li><li><span class="sd__mark"></span><b>placed_at</b><i>date</i></li></ul></button>
        <button type="button" class="sd__t sd__t--items" data-table="2" aria-label="Table order_items"><strong>order_items</strong><ul><li data-end="items.id"><span class="sd__mark"><svg viewBox="0 0 12 12" aria-hidden="true"><circle cx="4" cy="6" r="2.300"></circle><path d="M6.300 6h4.200M8.800 6v2M10.500 6v1.400"></path></svg></span><b>id</b><i>int</i></li><li data-end="items.order_id"><span class="sd__mark"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M5 7 7 5M4.300 5.200 3.200 6.300a1.800 1.800 0 0 0 2.500 2.500l1.100-1.100M7.700 6.800l1.100-1.100a1.800 1.800 0 0 0-2.500-2.500L5.200 4.300"></path></svg></span><b>order_id</b><i>int</i></li><li><span class="sd__mark"></span><b>product</b><i>text</i></li><li><span class="sd__mark"></span><b>qty</b><i>int</i></li></ul></button>
      </div>
      <p class="sd__info"><span class="sd__clip"><span data-outinfo>3 tables, 2 relations</span></span></p>
    </section>
    <span class="live" aria-live="polite" data-live></span>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></path></svg>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

Playground

Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.

36 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

Or ask your AI assistant for it

With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:

Take “Database schema” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On warm white, a white rounded card: “Schema” and on the right “shop_db”. Below, three tables drawn as small monospaced cards: top left “users” with “id”, “name” and “email”; on the right, lower down, “orders” with “id”, “user_id”, “total” and “placed_at”; bottom left “order_items” with “id”, “order_id”, “product” and “qty”. Beside each field its type; keys have a small drawn key, references a chain link. Two soft grey threads join “users.id” to “orders.user_id” and “orders.id” to “order_items.order_id”: on the one side a bar, on the many side the crow’s foot. Below, “3 tables, 2 relations”. On entering the tables rise one after the other and then the threads draw themselves. Pointing at “users” the table gives a small start, border and header turn green, the thread to “orders” redraws itself and green dashes run along it towards the orders; the two rows at the ends of the thread are tinted, “order_items” dims and below you read “One user has many orders”. On “orders” both threads light up.

How it works

Tables in HTML, threads in SVG

The tables are real elements, placed by hand in the board; over them is an svg as large as the board where the script draws the threads.

The thread starts from the row

Each thread measures where the two rows it joins really are and leaves from the side facing the other table, on a curve with two horizontal handles.

One and many

The bar and the crow’s foot are two small paths worked out from the same points: they give the direction of the relation without colour.

Lighting up

Pointing at a table lights the threads touching it: the path redraws itself and a second dashed path runs over it, from the one to the many.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#1f9d6bThe colour of the pointed table and its threads.
BENDscript.js0.55How much the threads between tables curve.
FLOWscript.js26How many pixels a second the dashes run along the lit thread, from the one to the many.
LOOPscript.jstrueLeft alone, the demo’s pointer points at the three tables one after the other.

Try them in the Playground

When to use it

On the page of a managed database, an ORM or a data modelling tool; in an API’s documentation, to show how resources are tied together; and in a developer’s portfolio, to tell a project’s model. The same threads between cards carry an org chart, a map of services or an automation flow.

On phones

The card is at most 348 pixels wide and about 320 tall; the board gets shorter on short screens and the threads are worked out again at every size change. With a finger a tap on a table lights it, a second tap or a tap elsewhere turns it off.

With reduced motion

No threads redrawing and no running dashes: pointing at a table changes colours, keys and text in one step and the lit thread stays still. The demo’s pointer does not start.

Pitfalls

  • The threads are worked out from the rows’ real sizes: they must be recalculated on resize and once the typeface has loaded, because the rows move.
  • The direction of the relation is in the bar and the crow’s foot, and in the sentence below: green only says which table you are looking at.
  • The tables are buttons: they take keyboard focus and the relation is told to screen readers too.
  • The running dashes are a second path over the first: animating the dash of the real thread would make it vanish in pieces.
  • Tables, fields and names are invented.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.0 KB; the libraries: GSAP 28 KB.

Testing

Tested on 1 December 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.

All animations