reactbits-mcp-server
Version:
MCP Server for React Bits - Access 99+ React components with animations, backgrounds, and UI elements
23 lines (18 loc) • 538 B
JSX
import { Flex, Switch, Text } from "@chakra-ui/react";
const PreviewSwitch = ({ title, isChecked, onChange, isDisabled }) => {
const handleChange = ({ checked }) => onChange?.(checked);
return (
<Flex align="center" gap="4" my={6}>
<Text fontSize="sm">{title}</Text>
<Switch.Root
checked={isChecked}
onCheckedChange={handleChange}
disabled={isDisabled}
>
<Switch.HiddenInput />
<Switch.Control />
</Switch.Root>
</Flex>
);
};
export default PreviewSwitch;