🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis β†’
Socket
Book a DemoInstallSign in
Socket

@berlitz/form

Package Overview
Dependencies
Maintainers
1
Versions
351
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@berlitz/form

Form component for the Max Design System

latest
npmnpm
Version
9.22.14
Version published
Maintainers
1
Created
Source

Form npm version

Creates a form from a provided schema.

Installation

yarn add @berlitz/form

Props

ArgumentTypeRequiredDefaultNotes
actionstringβœ…Added to the action attribute on the <form> element. Useful for making forms work when Javascript is disabled.
fieldsarrayβœ…Schema for generating the form fields. Refer to the proptypes for the required shape.
onSubmitfunctionβœ…Callback used to handle form submission. onSubmit(values, setSubmitting, setStatus, resetForm)
enableReinitializeboolean❌trueSets the Formik enableReinitialize prop. More info https://tinyurl.com/rzwvmhr
methodstring❌'post'Sets the method attribute on the <form> element.
hiddenFieldsarray❌Schema for generating hidden form fields.
lightboolean❌falseSets the background to a solid colour and changes all labels and text in the form to be light.
loadingLabelstring❌'Loading'Text for the submit button when it is loading.
onChangefunction❌Callback used to handle form changes. onChange(values)
submitLabelstring❌'Submit'Text for the submit button.
termsLabelstring❌Text for a Terms and Conditions checkbox. The checkbox will not show if no text is provided.
submitButtonRefobject❌A ref that is passed to the <SubmitButton /> on this form. Useful for triggering submit events outside of this component.
hideSubmitButtonboolean❌Useful in combination with submitButtonRef for showing a custom submit button outside of this component.

Usage

import Form from '@berlitz/form'

<Form
  action="/"
  onSubmit={(values, setSubmitting) => {
    alert(values)
    setTimeout(() => {
      setSubmitting(false)
    }, 2000)
  }}
  submitLabel="Find out more"
  fields={fields}
  hiddenFields={hiddenFields}
  termsLabel="I accept the terms"
  onChange={values => {
    setValues(values)
  }}
  light
/>

FAQs

Package last updated on 03 Jun 2025

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