Skip to content

Commit

Permalink
feat(toggle): add ReactNode type to toggle labels (#244)
Browse files Browse the repository at this point in the history
* feat(toggle): add ReactNode type to toggle labels

* fix(toggle): use only ReactNode as label type

---------

Co-authored-by: tobias-franzen <tobias.franzen@schibsted.com>
  • Loading branch information
Nytesoul and tobias-franzen authored Jun 5, 2024
1 parent 0c47104 commit abeff99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/toggle/src/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface ItemProps extends Pick<HTMLInputElement, 'type' | 'name'> {
invalid?: boolean;
helpId?: string;
noVisibleLabel?: boolean;
label?: string;
label?: React.ReactNode;
className?: string;
labelClassName?: string;
inputClassName?: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/toggle/src/props.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type ToggleEntry = {
label: string;
label: React.ReactNode;
value: unknown;
};

Expand Down Expand Up @@ -42,7 +42,7 @@ export interface ToggleProps {
/**
* If you only need to render a single option, use this prop instead
*/
label?: string;
label?: React.ReactNode;

/**
* Whether the single option should be checked (controlled)
Expand Down

0 comments on commit abeff99

Please sign in to comment.