UNPKG

@ducor/react

Version:

admin template ui interface

7 lines (6 loc) 637 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; var RadioGroup = function (_a) { var options = _a.options, name = _a.name, value = _a.value, onChange = _a.onChange; return (_jsx("div", { className: 'space-y-2', children: options.map(function (option) { return (_jsxs("label", { className: 'flex items-center space-x-2', children: [_jsx("input", { type: 'radio', name: name, value: option.value, checked: value === option.value, onChange: function () { return onChange(option.value); }, className: 'form-radio' }), _jsx("span", { children: option.label })] }, option.value)); }) })); }; export default RadioGroup;