📝 docs: add radio component to the example page

This commit is contained in:
Wahyu Kurniawan 2024-02-22 01:02:10 +07:00
parent cbc22fe16f
commit a17d5cfe3d
No known key found for this signature in database
GPG Key ID: 040A1549143A8E33
2 changed files with 40 additions and 0 deletions

View File

@ -13,10 +13,13 @@ import {
renderTabs, renderTabs,
renderVerticalTabs, renderVerticalTabs,
} from './renders/tabs'; } from './renders/tabs';
import { RADIO_OPTIONS } from './renders/radio';
import { Radio } from 'components/shared/Radio';
const Page = () => { const Page = () => {
const [singleDate, setSingleDate] = useState<Value>(); const [singleDate, setSingleDate] = useState<Value>();
const [dateRange, setDateRange] = useState<Value>(); const [dateRange, setDateRange] = useState<Value>();
const [selectedRadio, setSelectedRadio] = useState<string>('');
return ( return (
<div className="relative h-full min-h-full"> <div className="relative h-full min-h-full">
@ -112,6 +115,27 @@ const Page = () => {
<h1 className="text-2xl font-bold">Vertical Tabs</h1> <h1 className="text-2xl font-bold">Vertical Tabs</h1>
{renderVerticalTabs()} {renderVerticalTabs()}
</div> </div>
<div className="w-full h border border-gray-200 px-20 my-10" />
{/* Radio */}
<div className="flex flex-col gap-10 items-center justify-between">
<h1 className="text-2xl font-bold">Radio</h1>
<div className="flex gap-20 items-start">
<Radio
options={RADIO_OPTIONS}
orientation="vertical"
value={selectedRadio}
onValueChange={setSelectedRadio}
/>
<Radio
options={RADIO_OPTIONS}
orientation="horizontal"
value={selectedRadio}
onValueChange={setSelectedRadio}
/>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,16 @@
import { RadioOption } from 'components/shared/Radio';
export const RADIO_OPTIONS: RadioOption[] = [
{
label: 'Label 1',
value: '1',
},
{
label: 'Label 2',
value: '2',
},
{
label: 'Label 3',
value: '3',
},
];