You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@scaleway/form

Package Overview
Dependencies
Maintainers
8
Versions
290
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scaleway/form

Scaleway Form

1.47.0
latest
Source
npmnpm
Version published
Weekly downloads
199
521.88%
Maintainers
8
Weekly downloads
 
Created
Source

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.

Keywords

react

FAQs

Package last updated on 20 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts