UNPKG

@clayui/form

Version:
48 lines (47 loc) 1.24 kB
import classNames from "classnames"; import React from "react"; const Radio = React.forwardRef( ({ checked, children, className, containerProps = { className: "" }, inline, label, ...otherProps }, ref) => { return /* @__PURE__ */ React.createElement( "div", { ...containerProps, className: classNames( "custom-control custom-radio", containerProps.className, { "custom-control-inline": inline, "custom-control-outside": label } ) }, /* @__PURE__ */ React.createElement("label", null, /* @__PURE__ */ React.createElement( "input", { ...otherProps, checked, className: classNames( "custom-control-input", className ), ref, role: "radio", type: "radio" } ), /* @__PURE__ */ React.createElement("span", { className: "custom-control-label" }, label && /* @__PURE__ */ React.createElement("span", { className: "custom-control-label-text" }, label)), children) ); } ); Radio.displayName = "ClayRadio"; var Radio_default = Radio; export { Radio_default as default };