{"id":13560074,"url":"https://github.com/thangngoc89/bs-ant-design","last_synced_at":"2025-03-17T00:31:29.092Z","repository":{"id":29238224,"uuid":"115949198","full_name":"thangngoc89/bs-ant-design","owner":"thangngoc89","description":"Bucklescript + ReasonReact binding Ant Design","archived":false,"fork":false,"pushed_at":"2022-12-01T23:07:07.000Z","size":164,"stargazers_count":62,"open_issues_count":10,"forks_count":29,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-27T15:19:37.950Z","etag":null,"topics":["bucklescript","react","reason-react","reasonml"],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/thangngoc89.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":"2018-01-01T21:28:39.000Z","updated_at":"2023-12-26T09:50:01.000Z","dependencies_parsed_at":"2023-01-14T14:27:04.131Z","dependency_job_id":null,"html_url":"https://github.com/thangngoc89/bs-ant-design","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thangngoc89%2Fbs-ant-design","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thangngoc89%2Fbs-ant-design/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thangngoc89%2Fbs-ant-design/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thangngoc89%2Fbs-ant-design/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thangngoc89","download_url":"https://codeload.github.com/thangngoc89/bs-ant-design/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243835952,"owners_count":20355611,"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":["bucklescript","react","reason-react","reasonml"],"created_at":"2024-08-01T13:00:37.185Z","updated_at":"2025-03-17T00:31:28.808Z","avatar_url":"https://github.com/thangngoc89.png","language":"OCaml","funding_links":[],"categories":["Introduction","OCaml"],"sub_categories":[],"readme":"# bs-ant-design\n\n## Introduction\n\nBucklescript + ReasonReact binding for [Ant Design](https://ant.design) components. I write bindings when I needed them in my projects. If you find a component is missing, it's because I don't need it (yet).\n\nDifference from [bs-antd](https://github.com/tiensonqin/bs-antd) : It uses the official recommended way for writing bindings and it doesn't work for me. I explained this in this [blog post](https://khoanguyen.me/writing-reason-react-bindings-the-right-way/)\n\nI also attempted to rewrite the components when possible for a better integration.\n\n## Installation\n\n* With npm:\n\n```\nnpm install --save bs-ant-design\n```\n\n* With yarn:\n\n```\nyarn add bs-ant-design\n```\n\n* Add `bs-ant-design` to `bs-dependencies` in `bsconfig.json`.\n* You also need to set up your bundler to handle less files (This is a requirement from ant-design)\n\nFor webpack, you can do this:\n\n```\nnpm install --save-dev less@^2.7.3 less-loader css-loader style-loader\n```\n\n(`less@^2.7.3` is the important bit)\n\nNow add this to your webpack config:\n\n```js\n// webpack.config.js\nmodule.exports = {\n    ...\n    module: {\n        rules: [{\n        test: /\\.less$/,\n        use: [\"style-loader\", \"css-loader\", \"less-loader\"]\n    }]\n}\n};\n```\n\n## Usage\n\nPlease check [ant design's documentation for each component](https://ant.design/docs/react/introduce).\n\nI tried to keep the API as close to the original JS API as possible.\n\nSome common patterns I used:\n\n* string enums -\u003e polymorphic variants\n* function argument accepts different types: GDATs or `%identity` hack.\n\n## Components\n\n### Note:\n\n* 🔗: a binding\n* ✍️: rewrite in ReasonML\n* 🆕: new helpers\n\n### Implemented components\n\n#### 🔗 AutoComplete\n\n#### 🔗 Avatar\n\n#### 🔗 Breadcrumb\n\n#### 🔗 Button\n\n#### 🔗 Divider\n\n#### 🔗 Form\n\n#### 🔗 Grid\n\n#### 🔗 Input\n\n#### 🔗 Select\n\n#### 🔗 Steps\n\nUsage:\n\n* Single gutter size in pixels:\n\n```reason\nopen Antd.Grid;\n\n\u003cRow gutter=Row.SingleGutterInPx(4) align=`top\u003e\n    \u003cCol span=12 xs=Col.FullColSize(makeColSize(~span=5,()))\u003e  \n        (ReasonReact.stringToElement(\"A\"))\n    \u003c/Col\u003e\n    \u003cCol span=8 xs=Col.SingleColSize(4)\u003e  \n        (ReasonReact.stringToElement(\"B\"))\n    \u003c/Col\u003e\n\u003c/Row\u003e\n```\n\n* Responsive gutter:\n\n```reason\nopen Antd.Grid;\n\n\u003cRow gutter=Row.ResponsiveBreakpoints(makeGutterBreakpoints(~sm=5, ()))\u003e\n    \u003cCol span=8\u003e  \n        (ReasonReact.stringToElement(\"A\"))\n    \u003c/Col\u003e\n    \u003cCol span=8\u003e  \n        (ReasonReact.stringToElement(\"B\"))\n    \u003c/Col\u003e\n    \u003cCol span=8\u003e  \n        (ReasonReact.stringToElement(\"C\"))\n    \u003c/Col\u003e\n\u003c/Row\u003e\n```\n\n#### ✍️ Icon\n\nThis uses IconName\n\n#### ️🆕 IconName\n\nTypesafe way (only way) to access icon's name\n\n#### 🔗 Layout\n\n#### 🔗 Menu\n\n#### 🔗 Radio\n\n#### 🔗 Spin\n\n---\n\n## Contributions\n\nAll contributions are welcomed.\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthangngoc89%2Fbs-ant-design","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthangngoc89%2Fbs-ant-design","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthangngoc89%2Fbs-ant-design/lists"}