diff --git a/.changeset/healthy-monkeys-repair.md b/.changeset/healthy-monkeys-repair.md new file mode 100644 index 0000000000..d6f888ddf0 --- /dev/null +++ b/.changeset/healthy-monkeys-repair.md @@ -0,0 +1,5 @@ +--- +"@digdir/designsystemet-react": patch +--- + +Radio, Checkbox: Spread `className` and `style` on outermost element diff --git a/packages/react/src/components/Checkbox/Checkbox.tsx b/packages/react/src/components/Checkbox/Checkbox.tsx index 64a7f39296..8f73a0cee5 100644 --- a/packages/react/src/components/Checkbox/Checkbox.tsx +++ b/packages/react/src/components/Checkbox/Checkbox.tsx @@ -36,11 +36,20 @@ export type CheckboxProps = MergeRight< */ export const Checkbox = forwardRef( function Checkbox( - { 'data-size': size, children, label, description, validation, ...rest }, + { + 'data-size': size, + className, + style, + children, + label, + description, + validation, + ...rest + }, ref, ) { return ( - + {!!label && } {!!description &&
{description}
} diff --git a/packages/react/src/components/Radio/Radio.tsx b/packages/react/src/components/Radio/Radio.tsx index cb69ca0db4..8411f0d2ab 100644 --- a/packages/react/src/components/Radio/Radio.tsx +++ b/packages/react/src/components/Radio/Radio.tsx @@ -35,11 +35,20 @@ export type RadioProps = MergeRight< * */ export const Radio = forwardRef(function Radio( - { 'data-size': size, children, label, description, validation, ...rest }, + { + 'data-size': size, + className, + style, + children, + label, + description, + validation, + ...rest + }, ref, ) { return ( - + {!!label && } {!!description &&
{description}
}