Skip to content

About

54 built UI interaction pieces — motion, scroll and WebGL mechanisms as reusable apply() modules, each with the demo it was reviewed in.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

English | 简体中文

UI Material Library

The index page, with six pieces previewing live

The interaction effects in here already run. Take the one you want instead of writing it again.

Each was actually built, run in a browser, and looked at by a person one piece at a time — and only kept once it had been. What you install is the thing that was looked at, not a paragraph explaining roughly how the effect might work.

The source carries no styling. A module handles the mechanism and touches nothing else. 52 of the 54 spell out in their own manifest.json exactly what is not theirs: layout, colours, how a card looks, page chrome, copy, fonts — all of it stays your CSS and your DOM. So a piece drops into any visual direction without friction: you never redesign around it, and it never competes with your styling. Take the file, feed it your own tokens.

Install →

Working with it

Look, don't read. Open material/index.html and every piece runs live on the page. A sentence about a scroll effect tells you almost nothing; four seconds of it running tells you immediately whether it is the one. The "verified" marks on that page are not text someone typed — they are read off disk when you open it, so the page cannot claim one thing while the files say another. The interface follows your browser's language.

Taking a piece means copying one file. <slug>.js is all of it: no build step, no framework, no dependency on the demo it shipped beside.

Ask what fits and it will tell you the truth. Describe what goes in the block — what kind of content, how many items, how dense, which interactions cannot be lost — and it scans every labelled piece for the ones that can genuinely be built that way, simplest first. It always hands you a plain-HTML approach alongside them, and if nothing fits it says so instead of pushing the closest near-miss. The page and the suggest-material.js command line run the same judgement.

For agents: read manifest.json before the code. Its boundary states which parts the module handles and which remain yours — skip it and you will eventually have two effects both assuming page scroll belongs to them. known_defects is not filler: it records what was deliberately left unfixed. Those are the baseline later regressions are measured against, not bugs to fix on sight.

Don't trust it, check it. node material/_harness/check-form.js — a second, no browser, nothing to install. It compares each piece's verification receipt against the code on disk right now, so anything touched since it was last verified turns red immediately, including what you touched yourself.

What a piece is

<piece>/
├─ <slug>.js            the module — apply(container, opts) -> handle, with handle.destroy()
├─ index.html           the demo — and it applies that same module, not a second copy
├─ css/*.css            the demo's styles
├─ manifest.json        what it handles / what it does not · what you may tune · what is knowingly wrong
└─ _check/
   ├─ verbatim.json     load-bearing lines asserted character-for-character
   └─ gate-result.json  the verification receipt

One mechanism, one copy of the code. What the demo shows is the module itself running; it never writes its own version. Two copies drift apart eventually, and then the demo is showing something the module stopped doing a long time ago.

What is in it

54 pieces: scroll-driven motion, WebGL scenes, hover distortion, image transitions, pinned scroll sequences, cursors, loaders.

They are what this way of working produced, not the whole of what it can produce — so do not expect it to happen to cover every effect you need, but you can add to it the same way (how).

Two of the 54 did not pass the pixel-by-pixel comparison, and one more piece — which would have been the 55th — was never admitted at all: it never felt right on real hardware. All three say so on the index page rather than being folded into the ones that passed.

What is actually worth keeping is not the 54 pieces but the rules they share: one mechanism gets one copy of the code, the demo has to use that copy, manifest.json states how far it reaches, a receipt proves it has not been touched, and a check refuses to let those four disagree.

Building your own under the same rules

This repository is read-only. It is generated from a private working repo, so anything you edit inside an installed copy is overwritten by the next update rather than merged. Build yours in your own project instead, in the same structure, with material/_harness copied next to your pieces:

your-project/
├─ _harness/            <- copied from this package
└─ my-piece/
   ├─ my-piece.js       apply(container, opts) -> handle
   ├─ index.html        a demo that applies that same module
   └─ manifest.json     what it handles, what you may tune, what is knowingly wrong

cd your-project && node _harness/check-form.js

The check treats its own parent directory as the set to inspect, so it needs no configuration on your side.

It will report your piece as missing a verification receipt, because receipts come from the full pixel-by-pixel comparison and you are probably not running that. Record it rather than look past it: add a skip: "receipt" entry with a reason to _harness/exemptions.json and the check counts it as exempt and exits clean. An exemption you have to justify is a decision; a quietly lowered standard is a hole.

Install

/plugin marketplace add Melclycj/ui-material-library
/plugin install ui-material-library@ui-material-library

That installs the pieces plus the material-library skill, which is what lets an agent find and apply one by name or by the kind of content it holds.

ui-design-pipeline is the other half and installs separately: it starts from a line of intent, puts up several competing design directions to choose between, freezes the chosen one into a set of design tokens, and then builds out the remaining pages in parallel. Its reference lists describe these same effects at the level of direction and point here by name.

Either works on its own. Without the pipeline this is a component source you browse and copy from. Without these pieces the pipeline degrades honestly to described but not built and says as much, rather than pretending something is on hand. With both installed, the pipeline's reconciliation script — core/prototyping-ui-directions/scripts/check_registry_sync.py in that package — looks for an installed copy of this one by itself and reports which described effects actually exist. If it cannot find yours, or you want to pin the location, name it explicitly (the UI_MATERIAL_ROOT environment variable does the same):

python check_registry_sync.py --material-root <path-to-this-package>/material

Licences

Every piece's upstream licence is in ATTRIBUTION.md, generated from a record verified one piece at a time rather than assembled by hand: 40 trace to MIT upstreams (directly, or through the published terms of Codrops demos and public CodePen Pens) and 14 were written here, each with its basis stated. That file is a check against repository evidence and published terms, not legal advice — if what you are shipping needs a certain answer, verify the pieces you actually use. The packaging, the check scripts and the pieces written here are MIT (LICENSE).

material/README.md ships alongside the pieces so their provenance travels with them, but it is the maintenance manual of whoever maintains them: written in Chinese, with paths from the working repo, and steps pointing at things that only exist upstream. This README and the packaged skill are the ones written for you.

About

54 built UI interaction pieces — motion, scroll and WebGL mechanisms as reusable apply() modules, each with the demo it was reviewed in.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages