📝 docs: add vertical tabs to the example page

This commit is contained in:
Wahyu Kurniawan 2024-02-21 14:24:55 +07:00
parent e57591187c
commit a58fde78c4
No known key found for this signature in database
GPG Key ID: 040A1549143A8E33
2 changed files with 27 additions and 2 deletions

View File

@ -8,7 +8,11 @@ import {
import { avatars, avatarsFallback } from './renders/avatar'; import { avatars, avatarsFallback } from './renders/avatar';
import { renderBadges } from './renders/badge'; import { renderBadges } from './renders/badge';
import { renderButtonIcons, renderButtons } from './renders/button'; import { renderButtonIcons, renderButtons } from './renders/button';
import { renderTabWithBadges, renderTabs } from './renders/tabs'; import {
renderTabWithBadges,
renderTabs,
renderVerticalTabs,
} from './renders/tabs';
const Page = () => { const Page = () => {
const [singleDate, setSingleDate] = useState<Value>(); const [singleDate, setSingleDate] = useState<Value>();
@ -101,10 +105,12 @@ const Page = () => {
{/* Tabs */} {/* Tabs */}
<div className="flex flex-col gap-10 items-center justify-between"> <div className="flex flex-col gap-10 items-center justify-between">
<h1 className="text-2xl font-bold">Tabs</h1> <h1 className="text-2xl font-bold">Tabs</h1>
<div className="space-y-10"> <div className="flex flex-col gap-10 items-center justify-center">
{renderTabs()} {renderTabs()}
{renderTabWithBadges()} {renderTabWithBadges()}
</div> </div>
<h1 className="text-2xl font-bold">Vertical Tabs</h1>
{renderVerticalTabs()}
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import { Tabs } from 'components/shared/Tabs'; import { Tabs } from 'components/shared/Tabs';
import { Badge } from 'components/shared/Badge'; import { Badge } from 'components/shared/Badge';
import { GlobeIcon } from 'components/shared/CustomIcon';
const tabs = Array.from({ length: 8 }); const tabs = Array.from({ length: 8 });
@ -35,3 +36,21 @@ export const renderTabWithBadges = () => {
</Tabs> </Tabs>
); );
}; };
export const renderVerticalTabs = () => {
return (
<Tabs defaultValue="A" orientation="vertical">
<Tabs.List>
{tabs.slice(0, 4).map((_, index) => (
<Tabs.Trigger
key={index}
icon={<GlobeIcon />}
value={index.toString()}
>
Tab item {index}
</Tabs.Trigger>
))}
</Tabs.List>
</Tabs>
);
};