This package has been deprecated

Author message:

This package is deprecated use @ultraviolet/form instead.

@scaleway/form
TypeScript icon, indicating that this package has built-in type declarations

1.47.0 • Public • Published

Scaleway Form

npm version

Scaleway Form is an extension of Scaleway UI including everything to build forms using React. It is using React Final Form under the hood.

Installation

$ pnpm add @scaleway/form @emotion/react @emotion/styled

Usage

To use the library you need to put a ThemeProvider from @emotion/react with the theme that comes from @scaleway/ui then wrap all your fields inside a Form:

import { ThemeProvider } from '@emotion/react'
import { Form, TextInputField } from '@scaleway/form'
import { theme } from '@scaleway/ui'

export default function App() {
  return (
    <ThemeProvider theme={theme}>
      <Form>
        <TextInputField name="example" />
      </Form>
    </ThemeProvider>
  )
}

Contribute

Add a validator

  • Create a file under src/validators/ folder
  • Export a default function with a type : (arg: unknown) => ValidatorObject
  • Export it into src/validators/index.ts
  • Add the key into the ValidatorProps type in src/types.ts
  • Add tests into src/validators/__tests__ folder

Documentation

Checkout our documentation website.

Readme

Keywords

Package Sidebar

Install

npm i @scaleway/form

Weekly Downloads

2

Version

1.47.0

License

Apache-2.0

Unpacked Size

81.1 kB

Total Files

32

Last publish

Collaborators

  • codelax
  • quantumsheep
  • scaleway-bot
  • mprost
  • imanu
  • vincentaudebert
  • maliszewskid
  • phiphi