diff --git a/packages/dnb-eufemia/src/components/toggle-button/ToggleButton.d.ts b/packages/dnb-eufemia/src/components/toggle-button/ToggleButton.d.ts index edc074c5c7f..3ff3b53c62d 100644 --- a/packages/dnb-eufemia/src/components/toggle-button/ToggleButton.d.ts +++ b/packages/dnb-eufemia/src/components/toggle-button/ToggleButton.d.ts @@ -29,7 +29,7 @@ export interface ToggleButtonProps /** * (required) the text shown in the ToggleButton. */ - text?: string; + text?: React.ReactNode; /** * Use either the `label` property or provide a custom one. */ diff --git a/packages/dnb-eufemia/src/extensions/forms/Field/Selection/Selection.tsx b/packages/dnb-eufemia/src/extensions/forms/Field/Selection/Selection.tsx index 2d0789ebece..5c9db20a452 100644 --- a/packages/dnb-eufemia/src/extensions/forms/Field/Selection/Selection.tsx +++ b/packages/dnb-eufemia/src/extensions/forms/Field/Selection/Selection.tsx @@ -1,6 +1,6 @@ import React, { useMemo, useContext, useCallback } from 'react' import { - Button, + ToggleButton, Dropdown, Radio, HelpButton, @@ -14,6 +14,7 @@ import Option from '../Option' import { useDataValue } from '../../hooks' import { FormError, FieldProps, FieldHelpProps } from '../../types' import { pickSpacingProps } from '../../../../components/flex/utils' +import ToggleButtonGroupContext from '../../../../components/toggle-button/ToggleButtonGroupContext' interface IOption { title: string | React.ReactNode @@ -153,17 +154,21 @@ function Selection(props: Props) { return ( - {options.map((option, i) => ( -