Usage
import { AccountPicker } from 'nr1'
Examples
Props
Provide a descriptive label for this control, e.g. "Accounts".
Appends class names to the component.
Should be used only for positioning and spacing purposes.
false
Shows an option at the top named "All accounts". When selected, the
value provided by the onChange
callback is
AccountPicker.CROSS_ACCOUNT
. This is useful when you have
functionality that can operate on multiple accounts.
If true
, the dropdown is not available for interaction.
Text to display as label.
Display the label inline the form control.
Use only when the component is not inside a Form
. In that case set
layoutType
to Form.LAYOUT_TYPE.SPLIT
in the Form
component.
Callback fired every time the user clicks an account from the list.
function (event: React.MouseEvent, value: number Id of the account selected.
)
Spacing property. Spacing is defined as a tuple of zero to four
values, which follow the same conventions as CSS properties like
margin
or padding
. To omit a value, use SPACING_TYPE.OMIT
.
<Array of<One ofAccountPicker.SPACING_TYPE.EXTRA_LARGE,AccountPicker.SPACING_TYPE.LARGE,AccountPicker.SPACING_TYPE.MEDIUM,AccountPicker.SPACING_TYPE.NONE,AccountPicker.SPACING_TYPE.OMIT,AccountPicker.SPACING_TYPE.SMALL,>
>
Inline style for custom styling.
Should be used only for positioning and spacing purposes.
Adds a data-test-id
attribute. Use it to target the component in unit and
E2E tests.
For a test id to be valid, prefix it with your nerdpack id, followed up by a dot.
For example, my-nerdpack.some-element
.
Note: You might not see data-test-id
attributes as they are removed
from the DOM, to debug them pass a e2e-test
query parameter to the URL.
Id of the selected account.