Socket
Book a DemoInstallSign in
Socket

@slice-and-dice/govuk-react-date-field

Package Overview
Dependencies
Maintainers
9
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slice-and-dice/govuk-react-date-field

Date field component displaying day, month and year and featuring several configurable options.

0.7.3
latest
npmnpm
Version published
Weekly downloads
3
Maintainers
9
Weekly downloads
 
Created
Source

DateField

Import

  import DateField from '@govuk-react/date-field';

Usage

Simple

<DateField>What is your date of birth?</DateField>

Date with hint text

<DateField hintText="For example, 31 03 1980">
  What is your date of birth?
</DateField>

Date with hint text & error

<DateField
  hintText="For example, 31 03 1980"
  errorText="Error message goes here"
>
  What is your date of birth?
</DateField>

With custom input name props

<DateField hintText="For example, 31 03 1980"
  inputNames={{
    day: 'dayInputName',
    month: 'monthInputName',
    year: 'yearInputName',
  }}
 >
  What is your date of birth?
</DateField>

References:

  • https://github.com/alphagov/govuk-frontend/tree/master/src/components/date-field

Properties

PropRequiredDefaultTypeDescription
childrentrue``````node
defaultValues{ day: undefined, month: undefined, year: undefined, }custom
errorTextundefinedstringError text
hintTextundefinedstringOptional hint text
inputundefinedshape[object Object]Properties that are sent to the input, matching final form and redux form input type
inputNames{ day: undefined, month: undefined, year: undefined, }shape[object Object]Input name attributes

FAQs

Package last updated on 08 Apr 2021

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.