{"id":26180313,"url":"https://github.com/twp0217/react-mac-dock","last_synced_at":"2025-04-14T22:43:57.638Z","repository":{"id":57168428,"uuid":"405834069","full_name":"twp0217/react-mac-dock","owner":"twp0217","description":"React Mac Dock(Mac 程序坞)","archived":false,"fork":false,"pushed_at":"2021-09-15T05:14:30.000Z","size":2019,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T10:50:32.051Z","etag":null,"topics":["dock","mac","mac-dock","react","react-component","react-mac-dock"],"latest_commit_sha":null,"homepage":"https://twp0217.github.io/react-mac-dock/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twp0217.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-13T04:38:10.000Z","updated_at":"2023-04-17T14:45:26.000Z","dependencies_parsed_at":"2022-09-13T02:11:34.727Z","dependency_job_id":null,"html_url":"https://github.com/twp0217/react-mac-dock","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twp0217%2Freact-mac-dock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twp0217%2Freact-mac-dock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twp0217%2Freact-mac-dock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twp0217%2Freact-mac-dock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twp0217","download_url":"https://codeload.github.com/twp0217/react-mac-dock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975292,"owners_count":21192198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dock","mac","mac-dock","react","react-component","react-mac-dock"],"created_at":"2025-03-11T21:55:24.957Z","updated_at":"2025-04-14T22:43:57.617Z","avatar_url":"https://github.com/twp0217.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-mac-dock - Mac 程序坞\n\n## 使用\n\n```typescript\nimport React from 'react';\nimport MacDock, { MacDockItem } from '@twp0217/react-mac-dock';\nimport './index.less';\n\nexport default () =\u003e {\n  const items: MacDockItem[] = [\n    {\n      label: 'nautilus',\n      icon: 'https://twp0217.github.io/react-mac-dock/demo/nautilus.png',\n    },\n    {\n      label: 'opera',\n      icon: 'https://twp0217.github.io/react-mac-dock/demo/opera.png',\n    },\n    {\n      label: 'addressbook',\n      icon: 'https://twp0217.github.io/react-mac-dock/demo/addressbook.png',\n    },\n    {\n      label: 'dictionary',\n      icon: 'https://twp0217.github.io/react-mac-dock/demo/dictionary.png',\n    },\n    {\n      label: 'update',\n      icon: 'https://twp0217.github.io/react-mac-dock/demo/update.png',\n    },\n    {\n      label: 'settings',\n      icon: 'https://twp0217.github.io/react-mac-dock/demo/settings.png',\n    },\n    {\n      label: 'trash',\n      icon: 'https://twp0217.github.io/react-mac-dock/demo/trash.png',\n    },\n  ];\n\n  return (\n    \u003cdiv className=\"demo-container\"\u003e\n      \u003cMacDock items={items} /\u003e\n    \u003c/div\u003e\n  );\n};\n```\n\n## API\n\n### MacDockItem\n\n| 名称  | 类型             | 默认值 | 说明  |\n| ----- | ---------------- | ------ | ----- |\n| label | string \\| number | -      | key   |\n| icon  | number           | -      | label |\n\n### MacDockProps\n\n| 名称       | 类型                                                                | 默认值    | 说明             |\n| ---------- | ------------------------------------------------------------------- | --------- | ---------------- |\n| className  | string                                                              | -         | 类名             |\n| style      | React.CSSProperties                                                 | -         | 样式             |\n| placement  | `top` \\| `bottom` \\| `left` \\| `right`                              | `bottom`  | 位置             |\n| size       | `default` \\| `small` \\| number                                      | `default` | 图标大小         |\n| items      | MacDockItem[]                                                       | -         | 数据             |\n| renderItem | (item: MacDockItem, originNode: React.ReactNode) =\u003e React.ReactNode | -         | 自定义渲染列表项 |\n| onClick    | (item: MacDockItem) =\u003e void                                         | -         | 点击节点时的回调 |\n\n## 支持\n\n- 如果项目对你有帮助，请点颗星星:star:，谢谢。\n- 如果你对项目有想法、问题、BUG，欢迎讨论。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwp0217%2Freact-mac-dock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwp0217%2Freact-mac-dock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwp0217%2Freact-mac-dock/lists"}