瑚琏 Hulianv0.93.5413 组件0 组件
  • 开始
  • 组件
  • 区块
  • 页面
  • 模版
  • 更新
中文EN
  • 组件组件
  • 主题主题

背景

  • 点阵背景
  • 网格背景
  • 斜条纹背景
  • 径向辉光背景
  • 渐隐遮罩
  • 复古透视网格
  • 同心脉冲圆环
  • 流星雨
  • 极光渐变背景
  • 交互粒子场
  • 闪烁网格
  • 噪声波浪
  • 丝绸流动背景
  • 虹彩光泽背景
  • 流动丝线背景
  • 指针交互光球
  • 液态铬背景
  • 螺旋油彩
  • 彩球球池
  • 流动光柱
  • 多色流场
  • 暗色帷幕
  • 抖动波纹
  • 交互式点阵背景
  • 火焰邪眼
  • 故障终端雨
  • 铁磁流体
  • 漂浮线束
  • 视差星河
  • 渐变百叶窗
  • 颗粒渐变
  • 网格扭曲
  • 倾斜网格视差
  • 扫描网格
  • 跃迁隧道
  • 字符故障雨
  • 光束坠落
  • 电弧极光
  • 体积光柱
  • 光束放射
  • 波纹线阵
  • 液态色域
  • 点阵翻涌
  • 像素雪场
  • 等离子流动
  • 等离子波
  • 棱镜分光
  • 棱镜光爆
  • 雷达扫描
  • 涟漪网格
  • 几何网格
  • 侧光束
  • 柔和极光

覆盖特效

  • 边框光束
  • 流光边框
  • 反光悬停
  • 放大镜
  • 动效光束
  • 轨道环绕
  • 渐进模糊
  • 聚光卡片
  • 逐级揭示
  • 反重力粒子
  • 果冻光标
  • 点击火花
  • 准星十字线
  • 通电边框
  • 幽灵拖尾光标
  • 渐进贴边模糊
  • 光标图片拖尾
  • 激光束
  • 魔法光环
  • 指针磁吸
  • 磁力线网格
  • 黏液融球
  • 液态金属漆面
  • 轨道环绕
  • 像素余晖拖尾
  • 像素转场卡
  • 飘带跟随
  • 模糊形状高光
  • 流体溅射光标
  • 流星描边按钮
  • 可拖拽贴纸
  • 准星光标
  • 立方体阵列
  • 视差倾斜包裹器
  • 发光边框卡
  • 玻璃图标网格
  • 液态玻璃折射面
  • 挂绳工牌
  • 3D 模型舞台
  • 流体玻璃

LiquidEther

liquid-ether

一片会被指针搅动翻涌的液态色域

用法

基础用法

放进 relative 容器即可,组件自带 absolute inset-0;默认自动巡游搅动液面,颜色吃 chart token 明暗自适应。

LiquidEther
tsx
<div className="relative h-64 overflow-hidden rounded-xl bg-neutral-950">
  <LiquidEther />
  <div className="relative z-10 flex h-full items-center justify-center text-white/85">
    LiquidEther
  </div>
</div>

自定义调色板 · 大团块

colors 接任意 CSS 颜色(hex / oklch / var token);scale 越大色团越融合宏观,speed 控制翻涌速度。

tsx
<LiquidEther
  colors={[
    "var(--color-chart-3)",
    "oklch(0.72 0.22 30)",
    "var(--color-chart-1)",
  ]}
  scale={1.6}
  speed={0.7}
/>

静止待交互

autoDemo={false} 关掉自动巡游,画面静止等待真实指针;mouseForce 调大让搅动更跟手。

tsx
<LiquidEther autoDemo={false} mouseForce={1.5} />

壁纸级叠底

慢速 + 半透明(opacity)压低视觉重量,作为标题区背景叠在文字下方。

瑚琏组件库

液态色域 · 鼠标驱动

tsx
<div className="relative h-64 overflow-hidden rounded-xl bg-neutral-950">
  <LiquidEther speed={0.3} scale={1.2} opacity={0.7} />
  <div className="relative z-10 flex h-full flex-col items-center justify-center gap-2">
    <p className="text-lg font-semibold text-white">瑚琏组件库</p>
    <p className="text-xs text-white/60">液态色域 · 鼠标驱动</p>
  </div>
</div>

何时用

需要一层「跟手翻涌的液态色团」氛围背景(创意官网、产品 Hero、登录页)时用它,指针交互感最强。要规则点阵/网格选 DotPattern / GridPattern,要扫光聚焦选 Spotlight;本组件是有机色域流体,色彩重量大,常配 opacity 压低做壁纸底。

导入

ts
import { LiquidEther } from "@hulianui/ui"

Props

名称类型默认说明
colorsstring[]["var(--color-chart-1)","var(--color-chart-2)","var(--color-chart-4)"]调色板,至少 1 色(少于 2 会自动复制两端);任意 CSS 颜色串,随明暗主题切换
speednumber0.5流动速度因子;建议 0.2-1.5
scalenumber1液态团块尺度;越小越细碎越多团,越大越融合。建议 0.6-2
mouseForcenumber1指针扰动强度;0=无视指针纯漂流。建议 0-2
autoDemobooleantrue无人交互时虚拟光标自动巡游搅动;关闭则静止待真实指针
opacitynumber1整体不透明度 0-1;叠内容上常用 0.6-0.85 降视觉重量
classNamestring-透传到根容器(canvas 包裹层或 reduced fallback)
styleCSSProperties-透传到根容器的内联样式

Slots

插槽类型说明
fallbackReactNodereduced-motion / 无 WebGL 时的静态替代内容;默认多点 chart token radial-gradient 静态液面

禁忌 / 坑

  • 父容器须 relative + overflow-hidden,内容用 relative z-10 叠在上层;canvas 会满铺,叠加的文本建议加 pointer-events-none 避免吃掉指针搅动 [[webgl-canvas-rendered-but-invisible-negative-zindex-covered]]。
  • WebGL 客户端组件("use client");SSR 阶段只渲染 fallback,不会有 canvas。
  • colors 传 var(--color-…) 时运行时经离屏 canvas 解析,必须带 --color- 前缀,裸 var(--primary) 解析不出 [[oklch-css-var-color-must-parse-via-offscreen-canvas]]。
  • headless 截图常拍到静止/空白帧(rAF 动画被饿死),真机或 Playwright 实测才能看到流动 [[recharts-headless-screenshot-blank-clippath-animation-starved]]。

相关

DotPattern · GridPattern · StripedPattern · Spotlight · RetroGrid · Ripple

Playground

LiquidEther
<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.14 0.02 270)" }}>
  <LiquidEther
    speed={0.5}
    scale={1}
    mouseForce={1}
    autoDemo={true}
    opacity={1}
  />
</div>
上一个波纹线阵装饰下一个点阵翻涌

本页

  • 用法
  • 文档
    • 何时用
    • 导入
    • Props
    • Slots
    • 禁忌 / 坑
    • 相关
  • Playground