「功能网格」包含在 Pro 里,开通会员后显示预览。
用法
import { LandingFeatures } from './LandingFeatures.jsx'
// Your own features: each tile is data; `demo` is any element (or a function of the feature),
// and a tile without one lists its points. Tones: 'accent' | 'secondary' | 'tertiary'.
<LandingFeatures
locale="en"
labels={{ title: 'Brew better coffee', titleQuiet: ' cup after cup.' }}
features={[
{ id: 'log', icon: 'cup', title: 'Log every brew', text: 'Dose, grind and time in one tap.', points: ['Recipes saved', 'Timer built in'] },
{ id: 'taste', icon: 'star', tone: 'tertiary', title: 'Rate the taste', text: 'See what changed.', demo: <TasteChart /> },
]}
/>
// Or keep the four built-in demos of the sample app and feed them your numbers:
<LandingFeatures
locale="en"
schedule={plants} // [{ id, name, from, every: { summer, winter } }]
rooms={rooms} // [{ id, name, value }] humidity in %
journal={entries} // [{ id, date, note, leaves }]
onExplore={(feature, value) => track('feature-demo', { feature, value })}
/>属性
| 属性 | 类型 | 默认值 | 作用 |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | 内置文字和示例数据的语言。 |
features | Array<{ id, icon?, title, text, tone?: 'accent' | 'secondary' | 'tertiary', span?: 2 | 3 | 4 | 6, demo?: ReactNode | (feature) => ReactNode | 'season' | 'light' | 'humidity' | 'journal', points?: string[] }> | the four sample demos | 功能卡片。`demo` 是你自己的元素,或某个内置演示的名字;没有 demo 的卡片会列出 `points`。`span` 是它在六列中占几列(不填按数量自动排)。`icon` 是 kit 里的图标名。 |
schedule | Array<{ id, name, from, every: { summer, winter } }> | sample plants | 提醒演示里的植物:第一次浇水是哪天,以及每个季节隔几天浇一次。 |
rooms | Array<{ id, name, value }> | sample rooms | 湿度演示里的房间及其湿度百分比。 |
journal | Array<{ id, date, note, leaves }> | sample entries | 日记条目;每条对应的画中植物会长出 `leaves` 片叶子。 |
season / distance | 'summer' | 'winter' / number | 'summer' / 1.5 | 季节和光照演示的初始值。 |
onExplore | (feature, value) => void | — | 访客试用某个演示时调用:season、light、humidity 或 journal,以及选中的值。 |
labels | object | — | 替换任意内置文字(键名见 copy.js)。 |
className | string | — | 加在根元素 section 上。 |
装进你的项目
Pro 包含这个区块的完整源码。复制指令,让你的 Agent 把它安装到项目中。
LandingFeatures.jsxlanding-features.csscopy.jskit.jsxkit.cssui/rolling-number/ui/range-slider/ui/progress-ring/ui/sliding-tabs/tokens.cssREADME.md
区块本身、样式和文案、共用的 kit、用到的组件和 tokens.css 会一起装进同一个文件夹。
