AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

checkbox.tsx 1.1KB

123456789101112131415161718192021222324252627282930
  1. import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
  2. import { CheckIcon } from "lucide-react"
  3. import * as React from "react"
  4. import { cn } from "@/lib/utils"
  5. function Checkbox({
  6. className,
  7. ...props
  8. }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
  9. return (
  10. <CheckboxPrimitive.Root
  11. data-slot="checkbox"
  12. className={cn(
  13. "peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
  14. className
  15. )}
  16. {...props}
  17. >
  18. <CheckboxPrimitive.Indicator
  19. data-slot="checkbox-indicator"
  20. className="flex items-center justify-center text-current transition-none"
  21. >
  22. <CheckIcon className="size-3.5" />
  23. </CheckboxPrimitive.Indicator>
  24. </CheckboxPrimitive.Root>
  25. )
  26. }
  27. export { Checkbox }