Skip to content

Commit

Permalink
feat(@clayui/form): Toggle Switch adds sizing attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
pat270 committed Jan 11, 2024
1 parent ea5fdc5 commit d29270b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/clay-form/src/Toggle.tsx
Expand Up @@ -14,6 +14,7 @@ export interface IToggleProps
id?: string;
label?: React.ReactText;
onToggle?: (val: boolean) => void;
sizing?: string;
spritemap?: string;
symbol?: {on: string; off: string};
toggled?: boolean;
Expand All @@ -32,6 +33,7 @@ const ClayToggle = React.forwardRef<HTMLLabelElement, IToggleProps>(
onChange,
onToggle,
role = 'switch',
sizing,
spritemap,
symbol,
toggled,
Expand All @@ -52,7 +54,10 @@ const ClayToggle = React.forwardRef<HTMLLabelElement, IToggleProps>(
'toggle-switch',
'simple-toggle-switch',
containerProps.className,
{disabled}
{
disabled,
[`toggle-switch-${sizing}`]: sizing,
}
)}
ref={ref}
>
Expand Down

0 comments on commit d29270b

Please sign in to comment.