文档目录
IF 图标按钮
IF 图集按钮:状态图切换 + 悬停 1 px 白色内描边。
import { useState } from "react";
import { IfIconButton } from "./index";
export function IfIconButtonDemo() {
const [state, setState] = useState(0);
return (
<div className="relative h-40 w-64">
<IfIconButton
height={14}
label="区域"
left={8}
onClick={() => { setState(current => (current + 1) % 2); }}
state={state}
states={["showArea", "hideArea"]}
top={8}
width={14}
/>
<IfIconButton
height={18}
label="配方"
left={8}
state={0}
states={["itemBackground"]}
top={40}
width={18}
/>
</div>
);
}
安装
$pnpm add @tennantite/industrialforegoingnpm 方式安装编译产物;需要改造源码请用上方的 CLI 拷贝安装。
源码
packages/industrialforegoing/src/if-icon-button/index.tsxnpm 包保留源码目录,可直接复制改造。