-
Notifications
You must be signed in to change notification settings - Fork 0
Installation and Usage
github-actions[bot] edited this page Apr 10, 2026
·
1 revision
npm install interactive-surface-cssimport "interactive-surface-css";This works because the package entry file imports interactive-surface.css.
import "interactive-surface-css/interactive-surface.css";@import "interactive-surface-css/interactive-surface.css";<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/interactive-surface-css@latest/interactive-surface.css"
/>Install CSS loaders:
npm install -D css-loader style-loaderExample webpack.config.js rule:
module.exports = {
module: {
rules: [
{
test: /\.css$/i,
use: ["style-loader", "css-loader"]
}
]
}
};Then import in your app entry:
import "interactive-surface-css";<button class="interactive-surface">Submit</button><button class="interactive-surface variant-accent">Learn more</button><button class="interactive-surface size-lg surface-card">
<strong>Reusable elevation</strong>
<span>Keep interaction behavior consistent across surfaces.</span>
</button><button class="interactive-surface icon-only" aria-label="Search">
<svg aria-hidden="true" viewBox="0 0 24 24">...</svg>
</button><button class="interactive-surface" aria-pressed="true">Pinned</button><button class="interactive-surface" disabled>Unavailable</button>or
<button class="interactive-surface is-disabled" aria-disabled="true">Unavailable</button>import "interactive-surface-css";
export function SaveButton() {
return <button className="interactive-surface variant-primary">Save</button>;
}<script setup>
import "interactive-surface-css";
</script>
<template>
<button class="interactive-surface variant-primary">Save</button>
</template><script>
import "interactive-surface-css";
</script>
<button class="interactive-surface variant-primary">Save</button>interactive-surface owns transform-based motion on the host element.
Avoid applying additional transform, translate, scale, or rotate rules directly to the same node. If you need extra animation, put it on a child element instead.