跳转到主要内容
标题
一个基于下拉菜单的图标选择器,允许用户从列表中选择图标。
import React, { useState } from "react";
import { IconPicker } from "@/ui/input/components/IconPicker";

export const MyComponent = () => {

   const [selectedIcon, setSelectedIcon] = useState("");
   const handleIconChange = ({ iconKey, Icon }) => {
     console.log("Selected Icon:", iconKey);
     setSelectedIcon(iconKey);
   };

  return (
    <IconPicker
      disabled={false}
      onChange={handleIconChange}
      selectedIconKey={selectedIcon}
      variant="primary"
    />
  );
};