Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
import { forwardRef, type ElementRef, type ComponentProps } from "react";
export const defaultTag = "input";
export const Checkbox = forwardRef<
ElementRef<typeof defaultTag>,
Omit<ComponentProps<typeof defaultTag>, "type" | "value"> & { value?: string }
// Make sure children are not passed down to an input, because this will result in error.
>(({ children: _children, checked, defaultChecked, ...props }, ref) => {
return (
<input
{...props}
defaultChecked={checked ?? defaultChecked}
type="checkbox"
ref={ref}
/>
);
});
Checkbox.displayName = "Checkbox";