Skip to content

特性列表 FeatureList

FeatureList 用于以整洁的网格形式展示产品的一系列核心优势或技术特性。

核心优势

为什么选择 Mewx CMS UI?

零配置接入

零配置接入

基于 Tailwind 预设,一行代码即可完成样式配置。
类型安全

类型安全

全量 TypeScript 支持,内置 Zod 校验规则。
性能极致

性能极致

轻量级运行时,支持 Next.js 服务端渲染优化。
import { FeatureList } from '@goenhance/cms-ui';
const Example = () => (
<FeatureList
subtitle="核心特性"
title="卓越的开发体验"
list={[
{ title: "...", description: "...", icon: "..." }
]}
/>
);
属性类型默认值说明
titlestring-主标题
subtitlestring-顶部小字副标题
listFeatureListItem[][]特性列表项
classNamestring-附加到根元素的类名,可用于传入覆盖变量
属性类型说明
titlestring特性标题
descriptionstring特性描述文本
iconstring图标 URL (建议使用 SVG)

组件根节点挂有 mewx-cms-feature-list 类,所有样式均通过组件级 CSS 变量控制,优先级高于全局 --blocks-* 变量。

变量名用途默认值
--mewx-cms-feature-list-bg区块背景色var(--blocks-bg-section)
--mewx-cms-feature-list-subtitle-text副标题颜色var(--blocks-primary)
--mewx-cms-feature-list-heading-text主标题颜色var(--blocks-text-heading)
--mewx-cms-feature-list-card-bg卡片背景色var(--blocks-bg-card)
--mewx-cms-feature-list-card-border卡片边框色var(--blocks-border)
--mewx-cms-feature-list-card-radius卡片圆角var(--blocks-radius-2xl)
--mewx-cms-feature-list-card-shadow卡片阴影var(--blocks-shadow-card)
--mewx-cms-feature-list-card-hover-shadow悬停阴影var(--blocks-shadow-card-hover)
--mewx-cms-feature-list-card-hover-border悬停边框色var(--blocks-border-hover)
--mewx-cms-feature-list-icon-bg图标背景色var(--blocks-primary-lightest)
--mewx-cms-feature-list-icon-size图标容器尺寸4rem
--mewx-cms-feature-list-title-text卡片标题颜色var(--blocks-text-heading)
--mewx-cms-feature-list-desc-text卡片描述颜色var(--blocks-text-muted)

通过 CSS 类(推荐,作用域隔离)

/* 深色区块 */
.dark-section .mewx-cms-feature-list {
--mewx-cms-feature-list-bg: 15 23 42;
--mewx-cms-feature-list-heading-text: 255 255 255;
--mewx-cms-feature-list-card-bg: 30 41 59;
--mewx-cms-feature-list-card-border: 51 65 85;
--mewx-cms-feature-list-title-text: 248 250 252;
--mewx-cms-feature-list-desc-text: 148 163 184;
}

通过 inline style(适合动态值)

<FeatureList
style={{
"--mewx-cms-feature-list-bg": "245 240 255",
"--mewx-cms-feature-list-subtitle-text": "139 92 246",
"--mewx-cms-feature-list-icon-bg": "237 233 254",
} as React.CSSProperties}
subtitle="紫色主题"
title="自定义品牌色"
list={[...]}
/>

通过 className(Tailwind 任意值)

<FeatureList
className="[--mewx-cms-feature-list-card-radius:0.5rem] [--mewx-cms-feature-list-card-shadow:none]"
subtitle="方角无阴影"
title="扁平风格"
list={[...]}
/>
  • 动态网格:自动根据屏幕宽度在 1、2、3 列之间切换。
  • 悬停特效:内置边框高亮和阴影提升动画,增加交互质感。
  • 组件级变量:所有视觉属性均通过 --mewx-cms-feature-list-* 变量控制,覆盖不影响全局主题。