Socket
Book a DemoInstallSign in
Socket

@govuk-react/date-input

Package Overview
Dependencies
Maintainers
5
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@govuk-react/date-input

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

latest
npmnpm
Version
0.2.12
Version published
Weekly downloads
25
-60.94%
Maintainers
5
Weekly downloads
 
Created
Source

DateInput

Import

  import DateInput from '@govuk-react/date-input';

Usage

Simple

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

Date with hint text

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

Date with hint text & error

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

With custom input name props

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

References:

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

Properties

PropRequiredDefaultTypeDescription
childrentrue``````node
errorTextundefinedstringError text
hintTextundefinedstringOptional hint text
inputNames{ day: 'dateInputDay', month: 'dateInputMonth', year: 'dateInputYear', }shape[object Object]Input name attributes

FAQs

Package last updated on 26 Sep 2018

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