Demos
The locale is what determines the components placeholder
format .e.g. mm/åå
in norwegian, mm/yy
in english.
English (US) is not included in Eufemia by default. You can include it like:
import enUS from '@dnb/eufemia/shared/locales/en-US'<EufemiaProvider locale={enUS} ...>App</EufemiaProvider>
Demos
Empty
Code Editor
<Field.Expiry onChange={(expiry) => console.log('onChange', expiry)} />
Label
Code Editor
<Field.Expiry value="0835" label="Label text" onChange={(expiry) => console.log('onChange', expiry)} />
With help
Code Editor
<Field.Expiry label="Label text" help={{ title: 'Help is available', contents: 'Kindness and helping others will return to you when you least expect it, and maybe when you need it.', }} onChange={(expiry) => console.log('onChange', expiry)} />
Disabled
Code Editor
<Field.Expiry value="0826" label="Label text" onChange={(expiry) => console.log('onChange', expiry)} disabled />
Error
This is what is wrong...
Code Editor
<Field.Expiry value="0326" label="Label text" onChange={(expiry) => console.log('onChange', expiry)} error={new FormError('This is what is wrong...')} />
Validation - Required
Code Editor
<Field.Expiry value="0826" label="Label text" onChange={(expiry) => console.log('onChange', expiry)} required />