Skip to content

Import

import { Field } from '@dnb/eufemia/extensions/forms'
render(<Field.Name />)
render(<Field.Name.First />)
render(<Field.Name.Last />)
render(<Field.Name.Company />)

Description

Field.Name is a wrapper component for the input of strings, with user experience tailored for first name, last name and company names.

There is a corresponding Value.Name component.

import { Field, Form } from '@dnb/eufemia/extensions/forms'
function MyForm() {
return (
<Form.Handler>
<Field.Name />
<Field.Name.First value="Nora" />
<Field.Name.Last value="Mørk" />
<Field.Name.Company value="DNB" />
</Form.Handler>
)
}

Relevant links

Characteristics

  • Only letters and characters such as hyphens and spaces are allowed for Field.Name.First and Field.Name.Last (except Field.Name.Company, which can contain characters, letters and numbers, but must consist of at least three letters from the Norwegian alphabet).
  • Trailing spaces are removed.
  • The HTML autocomplete attribute is set to:
    • name by default.
    • given-name and family-name for Field.Name.First and Field.Name.Last.
    • organization-name for Field.Name.Company.