GitHub

ReScript bindings for antd

Getting Started

  1. Add this to your package.json:
yarn add @ant-design-rescript/components
  1. Add this to your rescript.json
"bs-dependencies": [
  "@rescript/react",
  "@ant-design-rescript/components",
]

Example Usage

Button

open AntDesignRescriptComponents.Components
@react.component
let make = () => {
  <Button loading={Button.BoolOrObject.Object({delay: 1.})}>
    {"Cancel"->React.string}
  </Button>
}

with @ant-design/icons

yarn add @ant-design-rescript/icons

bsconfig.json

"bs-dependencies": [
  "@rescript/react",
  "@ant-design-rescript/components",
  "@ant-design-rescript/icons"
]
open AntDesignRescriptIcons.Icons
open AntDesignRescriptComponents.Components
@react.component
let make = () => {
  <Button type_=#primary icon={<Outlined.Upload />}>
    {"Upload"->React.string}
  </Button>
}

Locale

open AntDesignRescriptComponents.Locales
@react.component
let make = () => {
  <ConfigProvider locale={zh_CN}>
    <App />
  </ConfigProvider>
}

Read the original on github.com ↗