diff --git a/app/components/Switch.tsx b/app/components/Switch.tsx index d2998a902..8dffea9dd 100644 --- a/app/components/Switch.tsx +++ b/app/components/Switch.tsx @@ -6,19 +6,28 @@ import Text from "~/components/Text"; import { undraggableOnDesktop } from "~/styles"; interface Props extends React.HTMLAttributes { + /** Width of the switch. Defaults to 32. */ width?: number; + /** Height of the switch. Defaults to 18 */ height?: number; + /** An optional label for the switch */ label?: string; - name?: string; + /** Whether the label should be positioned on left or right. Defaults to right */ + labelPosition?: "left" | "right"; + /** An optional note to display below the switch */ note?: React.ReactNode; + /** Name of the input */ + name?: string; + /** Whether the switch is checked */ checked?: boolean; + /** Whether the switch is disabled */ disabled?: boolean; - onChange: (event: React.ChangeEvent) => unknown; } function Switch({ width = 32, height = 18, + labelPosition = "left", label, disabled, className, @@ -45,7 +54,12 @@ function Switch({ if (label) { return ( -