Skip to content

Import

import { Value } from '@dnb/eufemia/extensions/forms'
render(<Value.Provider />)

Description

The Value.Provider lets you pass generic properties to all nested Value.* components.

import { Field, Value } from '@dnb/eufemia/extensions/forms'
render(
<>
<Field.Boolean path="/myPath" label="My label" />
<Value.Provider inheritLabel>
<Value.Boolean path="/myPath" />
</Value.Provider>
</>,
)

Relevant links

Demos

Inherit visibility

Code Editor
<Form.Handler>
  <Form.Card>
    <Field.Boolean
      variant="button"
      path="/isVisible"
      defaultValue={true}
    />

    <Form.Visibility pathTrue="/isVisible" animate>
      <Field.Name.First path="/foo" defaultValue="foo" />
      <Field.Name.Last path="/bar" defaultValue="bar" />
    </Form.Visibility>

    <Value.Provider inheritVisibility>
      <Value.SummaryList>
        <Value.Name.First path="/foo" />
        <Value.Name.First path="/bar" />
      </Value.SummaryList>
    </Value.Provider>
  </Form.Card>
</Form.Handler>