mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
48 lines
1.1 KiB
TypeScript
48 lines
1.1 KiB
TypeScript
const App = `import {RadioGroup, Radio, cn} from "@nextui-org/react";
|
|
|
|
export const CustomRadio = (props) => {
|
|
const {children, ...otherProps} = props;
|
|
|
|
return (
|
|
<Radio
|
|
{...otherProps}
|
|
classNames={{
|
|
base: cn(
|
|
"inline-flex m-0 bg-content1 hover:bg-content2 items-center justify-between",
|
|
"flex-row-reverse max-w-[300px] cursor-pointer rounded-lg gap-4 p-4 border-2 border-transparent",
|
|
"data-[selected=true]:border-primary"
|
|
),
|
|
}}
|
|
>
|
|
{children}
|
|
</Radio>
|
|
);
|
|
};
|
|
|
|
export default function App() {
|
|
return (
|
|
<RadioGroup label="Plans" description="Selected plan can be changed at any time.">
|
|
<CustomRadio description="Up to 20 items" value="free">
|
|
Free
|
|
</CustomRadio>
|
|
<CustomRadio description="Unlimited items. $10 per month." value="pro">
|
|
Pro
|
|
</CustomRadio>
|
|
<CustomRadio
|
|
description="24/7 support. Contact us for pricing."
|
|
value="enterprise"
|
|
>
|
|
Enterprise
|
|
</CustomRadio>
|
|
</RadioGroup>
|
|
);
|
|
}`;
|
|
|
|
const react = {
|
|
"/App.jsx": App,
|
|
};
|
|
|
|
export default {
|
|
...react,
|
|
};
|