Heroes JS behaviour

Glass hero

A liquid-glass panel floating over calmly drifting gradient blobs — it drinks the background’s blur and saturation and catches light on its edges; inside, a short sign-in form with live validation and fine-print guarantees.

Documentation

Real scenarios

The component as it is used in a product — not a specimen grid.

Asterly for teams

Sign in to the calm console

One glass pane between you and every rollout — no passwords to remember, just a magic link.

Important props

Important props
Prop Type Default What it does
backdrop-filter blur 'blur(22px) saturate(160%)' The liquid-glass heart; the glass frosts and saturates the background so the blobs glow through like colour behind frosted panes.
edge-light border '1px · inset 1px' A translucent border plus the inner highlight along the panel’s top — the lit edge real glass has.
blobs layers '3' Three gradient blobs on 20–30s cycles; they freeze under prefers-reduced-motion.
validation event 'submit' On submit the email is checked; an error shakes the input with a message, success swaps the panel to the magic-link confirmation.

Snippet

<section class="hrg">
    <i class="hrg-blob" aria-hidden="true"></i>
    <i class="hrg-blob" aria-hidden="true"></i>

    <form class="hrg-panel" x-data="{ email: '', sent: false, shake: false,
            get bad() { return this.email && !this.email.includes('@') } }"
        x-on:submit.prevent="email.includes('@') ? sent = true : (shake = true, setTimeout(() => shake = false, 400))">
        <h1 class="hrg-title">Create your workspace</h1>
        <input class="hrg-input" type="email" x-model="email" placeholder="you@team.com">
        <button class="hrg-btn">Continue with a magic link</button>
        <small class="hrg-fine">14-day trial · no card · SOC 2</small>
        <p x-show="sent">Check your inbox ✓</p>
    </form>
</section>

<style>
.hrg { position: relative; overflow: clip; display: grid; place-items: center;
       padding: 5rem 1.25rem; background: #0f122e; }
.hrg-blob { position: absolute; inline-size: 26rem; aspect-ratio: 1; filter: blur(70px);
       border-radius: 50%; background: #6d7cff; opacity: .55;
       animation: hrg-drift 24s ease-in-out infinite alternate; }
.hrg-panel { inline-size: min(100%, 24rem); padding: 2rem; border-radius: 1.75rem;
       background: #ffffff1a; border: 1px solid #ffffff33; color: #eef1ff;
       backdrop-filter: blur(22px) saturate(160%);
       box-shadow: inset 0 1px 0 #ffffff40, 0 24px 60px #0b102066; }
.hrg-input { inline-size: 100%; padding: .8rem 1rem; border-radius: .9rem;
       border: 1px solid #ffffff33; background: #ffffff14; color: inherit; }
@keyframes hrg-drift { to { translate: 6rem -4rem; } }
@media (prefers-reduced-motion: reduce) { .hrg-blob { animation: none; } }
</style>
// resources/js/Pages/Landing.jsx — the Inertia (React) page; renders the
// React snippet below unchanged inside the app’s provider.
import { Link } from '@inertiajs/react';
import { NabuXUIProvider } from '@nabuxai/ui-react';
import GlassHero from '@/components/heroes/GlassHero';

export default function Landing() {
  return (
    <NabuXUIProvider locale="en" linkComponent={Link}>
      <GlassHero />
    </NabuXUIProvider>
  );
}
// GlassHero.jsx — liquid-glass sign-in panel over drifting blobs
import { useState } from 'react';

export default function GlassHero() {
  const [email, setEmail] = useState('');
  const [sent, setSent] = useState(false);
  const [shake, setShake] = useState(false);

  const submit = (e) => {
    e.preventDefault();
    if (email.includes('@')) setSent(true);
    else {
      setShake(true);
      setTimeout(() => setShake(false), 400);
    }
  };

  return (
    <>
      <style>{`
        .hrg { position: relative; overflow: clip; display: grid; place-items: center;
                padding: 5rem 1.25rem; background: #0f122e; }
        .hrg-blob { position: absolute; inline-size: 26rem; aspect-ratio: 1; filter: blur(70px);
                border-radius: 50%; background: #6d7cff; opacity: .55;
                animation: hrg-drift 24s ease-in-out infinite alternate; }
        .hrg-panel { position: relative; inline-size: min(100%, 24rem); padding: 2rem;
                border-radius: 1.75rem; background: #ffffff1a; border: 1px solid #ffffff33;
                color: #eef1ff; backdrop-filter: blur(22px) saturate(160%);
                box-shadow: inset 0 1px 0 #ffffff40, 0 24px 60px #0b102066; display: grid; gap: 1rem; }
        .hrg-input { inline-size: 100%; padding: .8rem 1rem; border-radius: .9rem;
                border: 1px solid #ffffff33; background: #ffffff14; color: inherit; }
        .hrg-btn { block-size: 2.9rem; border: none; border-radius: .9rem;
                background: #eef1ff; color: #0f122e; font-weight: 600; cursor: pointer; }
        .hrg-shake { animation: hrg-shake .4s; }
        @keyframes hrg-drift { to { translate: 6rem -4rem; } }
        @keyframes hrg-shake { 25% { translate: -.4rem 0; } 75% { translate: .4rem 0; } }
        @media (prefers-reduced-motion: reduce) { .hrg-blob { animation: none; } }
      `}</style>
      <section className="hrg">
        <i className="hrg-blob" aria-hidden="true" />
        <i className="hrg-blob" aria-hidden="true" />
        {sent ? (
          <div className="hrg-panel">
            <h1 className="hrg-title">Check your inbox</h1>
            <p>We sent a magic link to <b>{email}</b>. It lives for 15 minutes.</p>
          </div>
        ) : (
          <form className="hrg-panel" onSubmit={submit}>
            <h1 className="hrg-title">Create your workspace</h1>
            <input className={`hrg-input ${shake ? 'hrg-shake' : ''}`} type="email" value={email}
                   onChange={(e) => setEmail(e.target.value)} placeholder="you@team.com" />
            <button className="hrg-btn" type="submit">Continue with a magic link</button>
            <small className="hrg-fine">14-day trial · no card · SOC 2</small>
          </form>
        )}
      </section>
    </>
  );
}
<!-- GlassHero.vue — liquid-glass sign-in panel over drifting blobs -->
<script setup>
import { ref } from 'vue';

const email = ref('');
const sent = ref(false);
const shake = ref(false);

function submit() {
  if (email.value.includes('@')) sent.value = true;
  else {
    shake.value = true;
    setTimeout(() => (shake.value = false), 400);
  }
}
</script>

<template>
  <section class="hrg">
    <i class="hrg-blob" aria-hidden="true"></i>
    <i class="hrg-blob" aria-hidden="true"></i>
    <div v-if="sent" class="hrg-panel">
      <h1 class="hrg-title">Check your inbox</h1>
      <p>We sent a magic link to <b>{{ email }}</b>. It lives for 15 minutes.</p>
    </div>
    <form v-else class="hrg-panel" @submit.prevent="submit">
      <h1 class="hrg-title">Create your workspace</h1>
      <input class="hrg-input" :class="{ 'hrg-shake': shake }" type="email"
             v-model="email" placeholder="you@team.com" />
      <button class="hrg-btn" type="submit">Continue with a magic link</button>
      <small class="hrg-fine">14-day trial · no card · SOC 2</small>
    </form>
  </section>
</template>

<style scoped>
.hrg { position: relative; overflow: clip; display: grid; place-items: center;
       padding: 5rem 1.25rem; background: #0f122e; }
.hrg-blob { position: absolute; inline-size: 26rem; aspect-ratio: 1; filter: blur(70px);
       border-radius: 50%; background: #6d7cff; opacity: .55;
       animation: hrg-drift 24s ease-in-out infinite alternate; }
.hrg-panel { position: relative; inline-size: min(100%, 24rem); padding: 2rem;
       border-radius: 1.75rem; background: #ffffff1a; border: 1px solid #ffffff33;
       color: #eef1ff; backdrop-filter: blur(22px) saturate(160%);
       box-shadow: inset 0 1px 0 #ffffff40, 0 24px 60px #0b102066; display: grid; gap: 1rem; }
.hrg-input { inline-size: 100%; padding: .8rem 1rem; border-radius: .9rem;
       border: 1px solid #ffffff33; background: #ffffff14; color: inherit; }
.hrg-btn { block-size: 2.9rem; border: none; border-radius: .9rem;
       background: #eef1ff; color: #0f122e; font-weight: 600; cursor: pointer; }
.hrg-shake { animation: hrg-shake .4s; }
@keyframes hrg-drift { to { translate: 6rem -4rem; } }
@keyframes hrg-shake { 25% { translate: -.4rem 0; } 75% { translate: .4rem 0; } }
</style>
<!-- GlassHero.svelte — liquid-glass sign-in panel over drifting blobs -->
<script>
  let email = $state('');
  let sent = $state(false);
  let shake = $state(false);

  function submit(e) {
    e.preventDefault();
    if (email.includes('@')) sent = true;
    else {
      shake = true;
      setTimeout(() => (shake = false), 400);
    }
  }
</script>

<section class="hrg">
  <i class="hrg-blob" aria-hidden="true"></i>
  <i class="hrg-blob" aria-hidden="true"></i>
  {#if sent}
    <div class="hrg-panel">
      <h1 class="hrg-title">Check your inbox</h1>
      <p>We sent a magic link to <b>{email}</b>. It lives for 15 minutes.</p>
    </div>
  {:else}
    <form class="hrg-panel" onsubmit={submit}>
      <h1 class="hrg-title">Create your workspace</h1>
      <input class="hrg-input" class:hrg-shake={shake} type="email"
             bind:value={email} placeholder="you@team.com" />
      <button class="hrg-btn" type="submit">Continue with a magic link</button>
      <small class="hrg-fine">14-day trial · no card · SOC 2</small>
    </form>
  {/if}
</section>

<style>
.hrg { position: relative; overflow: clip; display: grid; place-items: center;
       padding: 5rem 1.25rem; background: #0f122e; }
.hrg-blob { position: absolute; inline-size: 26rem; aspect-ratio: 1; filter: blur(70px);
       border-radius: 50%; background: #6d7cff; opacity: .55;
       animation: hrg-drift 24s ease-in-out infinite alternate; }
.hrg-panel { position: relative; inline-size: min(100%, 24rem); padding: 2rem;
       border-radius: 1.75rem; background: #ffffff1a; border: 1px solid #ffffff33;
       color: #eef1ff; backdrop-filter: blur(22px) saturate(160%);
       box-shadow: inset 0 1px 0 #ffffff40, 0 24px 60px #0b102066; display: grid; gap: 1rem; }
.hrg-input { inline-size: 100%; padding: .8rem 1rem; border-radius: .9rem;
       border: 1px solid #ffffff33; background: #ffffff14; color: inherit; }
.hrg-btn { block-size: 2.9rem; border: none; border-radius: .9rem;
       background: #eef1ff; color: #0f122e; font-weight: 600; cursor: pointer; }
.hrg-shake { animation: hrg-shake .4s; }
@keyframes hrg-drift { to { translate: 6rem -4rem; } }
@keyframes hrg-shake { 25% { translate: -.4rem 0; } 75% { translate: .4rem 0; } }
</style>