Skip to Content
UI组件

缩放选择

🌐 Zoom Select

缩放控件,可让你使用选择下拉菜单无缝放大和缩小。

🌐 A zoom control that lets you zoom in and out seamlessly using a select dropdown.

安装

在安装组件之前,务必遵循 先决条件

npx shadcn@latest add https://ui.reactflow.dev/zoom-select

用法

1. Connect the component with your React Flow application.

import { Background, ReactFlow } from "@xyflow/react"; import { ZoomSelect } from "@/registry/components/zoom-select/"; const defaultNodes = [ { id: "1", position: { x: 200, y: 200 }, data: { label: "Node" }, }, ]; export default function App() { return ( <div className="h-full w-full"> <ReactFlow defaultNodes={defaultNodes} fitView> <Background /> <ZoomSelect position="top-left" /> </ReactFlow> </div> ); }
Last updated on