@react-formless/antd

ant-design render map for @react-formless/core

Usage no npm install needed!

<script type="module">
  import reactFormlessAntd from 'https://cdn.skypack.dev/@react-formless/antd';
</script>

README

@react-formless/antd

tests status

Ant Design render map for @react-formless/core.

Check custom renderers in action

import * as React from "react"

import { useFormHook, FormView, FormSchema } from "@react-formless/core"
import { antDesignRenderMap } from "@react-formless/antd"

export type Car = { make: string }

const carMakes: Array<[string, string]> = [
    ["Tesla", "tesla-id"],
    ["Honda", "honda-id"],
    ["BMW", "bmw-id"]
]

const schema: FormSchema<Car> = { make: { type: "select", values: carMakes } }

export const AntDesignForm: React.FC = () => {
    const { formViewProps } = useFormHook({ schema })
    return <FormView {...formViewProps} inputsRenderMap={antDesignRenderMap} />
}

Checkout full example

Install

Using npm:

npm i --save-dev @react-formless/antd

or using yarn:

yarn add @react-formless/antd --dev

For more in depth documentation see @react-formless.