diff --git a/src/lib/form/custom-radio.tsx b/src/lib/form/custom-radio.tsx new file mode 100644 index 0000000..7bb534d --- /dev/null +++ b/src/lib/form/custom-radio.tsx @@ -0,0 +1,114 @@ +import React, { ReactNode } from "react"; +import { + Radio as AriaRadio, + RadioGroup as AriaRadioGroup, + FieldError, + type FieldErrorProps, + Label, + type RadioGroupProps as AriaRadioGroupProps, + type RadioProps as AriaRadioProps, + type RadioRenderProps, +} from "react-aria-components"; +import { cn } from "../../utils"; + +export { RadioIndicator } from "./radio-indicator"; + +interface CustomRadioItemProps extends Omit { + className?: string; +} + +/** A single radio whose content is fully owned by the caller. Use the render-prop + * `children` to receive `{ isSelected, isHovered, isFocusVisible, ... }` and compose your + * own UI (cards, labels, ...), placing a `` where you want it. Renders a + * `