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

背景

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

覆盖特效

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

GlassIcons

glass-icons

把图标动作摆在玻璃拟态方块上,悬停时抬升旋转

用法

基础用法

传入 items(图标 + 标签 + 配色),hover/focus 看玻璃 3D 抬升与标签滑出。

tsx
import { Heart, Star, Bell, Cloud, Zap, Settings } from "lucide-react";

<GlassIcons
  columns={3}
  items={[
    { icon: <Heart />, label: "收藏", color: "red" },
    { icon: <Star />, label: "星标", color: "orange" },
    { icon: <Bell />, label: "通知", color: "blue" },
    { icon: <Cloud />, label: "云端", color: "indigo" },
    { icon: <Zap />, label: "闪电", color: "purple" },
    { icon: <Settings />, label: "设置", color: "green" },
  ]}
/>

网格列数

columns 控制网格列数,窄屏自动回落到 2 列。

tsx
<GlassIcons
  columns={2}
  items={[
    { icon: <Heart />, label: "收藏", color: "red" },
    { icon: <Star />, label: "星标", color: "orange" },
    { icon: <Bell />, label: "通知", color: "blue" },
    { icon: <Cloud />, label: "云端", color: "indigo" },
  ]}
/>

单色主题色

color 传 'primary' 让发光板吃主题主色,自动适配明暗。

tsx
<GlassIcons
  columns={2}
  items={[
    { icon: <Heart />, label: "喜欢", color: "primary" },
    { icon: <Star />, label: "收藏", color: "primary" },
  ]}
/>

自定义渐变色

color 除预设名外还可传任意 CSS 渐变字符串。

tsx
<GlassIcons
  columns={2}
  items={[
    {
      icon: <Cloud />,
      label: "极光",
      color: "linear-gradient(135deg, var(--color-chart-1), var(--color-chart-4))",
    },
    {
      icon: <Zap />,
      label: "暖橙",
      color: "linear-gradient(135deg, var(--color-chart-3), oklch(0.72 0.2 30))",
    },
  ]}
/>

何时用

需要一组玻璃拟态、带 3D 抬升发光交互的图标按钮网格(如功能入口/分类导航/快捷操作)时用。要给单个元素加边框光带用 BorderBeam/ShineBorder;要做眩光悬停用 GlareHover。GlassIcons 是「一组带标签的可点图标」,自带无障碍名。

导入

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

Props

GlassIconsProps

名称类型默认说明
items*GlassIconItem[]-图标项列表,按网格依次渲染为玻璃按钮
columnsnumber3网格列数,窄屏自动回落到更少列
classNamestring-透传根网格容器 className(可覆盖列数/间距/对齐)
styleCSSProperties-透传根容器内联样式

GlassIconItem · Props

名称类型默认说明
label*string-hover/focus 滑出的文字,同时作按钮 aria-label
colorstring"primary"背面发光配色,预设名 primary|blue|purple|red|indigo|orange|green,或任意 CSS 颜色/渐变
classNamestring-透传该按钮 className

GlassIconItem · Events

事件类型说明
onClick() => void点击该图标按钮时回调

GlassIconItem · Slots

插槽类型说明
icon*ReactNode图标节点(通常 lucide-react),渲染于玻璃前层中央,aria-hidden

禁忌 / 坑

  • label 既是滑出文字也是 aria-label,必填,不要为视觉留空——否则按钮失去无障碍名。
  • 玻璃发光在深色背景上才清晰,浅底下效果弱;color 喂 token/渐变时务必带 --color- 前缀。
  • 容器需 overflow-visible,否则 3D 抬升与标签滑出会被裁切。

相关

BorderBeam · ShineBorder · GlareHover · Lens · AnimatedBeam · OrbitingCircles

Playground

import { Heart, Star, Bell } from "lucide-react";

<GlassIcons
  columns={3}
  items={[
    { icon: <Heart />, label: "收藏", color: "red" },
    { icon: <Star />, label: "星标", color: "orange" },
    { icon: <Bell />, label: "通知", color: "blue" },
  ]}
/>
上一个发光边框卡装饰下一个液态玻璃折射面

本页

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