import React, { useState } from 'react';
import { Screen, View, Text, Icon } from '@idealyst/components';
import TabBar from '../TabBar';
import type { TabBarItem } from '../TabBar/types';
export const TabBarExamples: React.FC = () => {
const [activeTab, setActiveTab] = useState('tab1');
const [variantTab, setVariantTab] = useState('home');
const [pillTab, setPillTab] = useState('tab1');
const [iconTab, setIconTab] = useState('home');
const [justifyTab, setJustifyTab] = useState('tab1');
const basicTabs: TabBarItem[] = [
{ value: 'tab1', label: 'Tab 1' },
{ value: 'tab2', label: 'Tab 2' },
{ value: 'tab3', label: 'Tab 3' },
];
const variantTabs: TabBarItem[] = [
{ value: 'home', label: 'Home' },
{ value: 'search', label: 'Search' },
{ value: 'settings', label: 'Settings' },
];
const disabledTabs: TabBarItem[] = [
{ value: 'tab1', label: 'Enabled' },
{ value: 'tab2', label: 'Disabled', disabled: true },
{ value: 'tab3', label: 'Enabled' },
];
// Tabs with icons using render function
const iconTabs: TabBarItem[] = [
{
value: 'home',
label: 'Home',
icon: ({ active, size }) => (
),
},
{
value: 'search',
label: 'Search',
icon: ({ active, size }) => (
),
},
{
value: 'profile',
label: 'Profile',
icon: ({ active, size }) => (
),
},
{
value: 'settings',
label: 'Settings',
icon: ({ active, size }) => (
),
},
];
return (
TabBar Examples
Basic TabBar
Active tab: {activeTab}
Variants
Standard
Pills
Underline
Sizes
Pill Modes
Light Mode (dark pill on light background)
Dark Mode (light pill on dark background)
Disabled Tabs
With Icons
Icons Left (default)
Icons Top (stacked)
Pills with Icons
Layout Justification
Start (default)
Center
Equal (full width, equal tabs)
Space Between
Full Width with Icons
);
};
export default TabBarExamples;