@lynx-js/lynx-ui-tab-group
v3.143.0
Published
Composable primitives for building tab navigation with lynx-ui. The package provides `TabsRoot`, `TabsBar`, `TabsItem`, `TabsIndicator`, and an optional swipeable `TabsPanel`.
Downloads
10,309
Readme
@lynx-js/lynx-ui-tab-group
Composable primitives for building tab navigation with lynx-ui. The package provides TabsRoot, TabsBar, TabsItem, TabsIndicator, and an optional swipeable TabsPanel.
Installation
pnpm add @lynx-js/lynx-uiBasic usage
import { root } from '@lynx-js/react'
import {
TabsBar,
TabsIndicator,
TabsItem,
TabsRoot,
} from '@lynx-js/lynx-ui'
const tabs = ['Home', 'Profile']
export function App() {
return (
<TabsRoot>
<TabsBar
data={tabs}
renderTabItem={item => (
<TabsItem>
<text>{item}</text>
</TabsItem>
)}
>
<TabsIndicator />
</TabsBar>
</TabsRoot>
)
}
root.render(<App />)See the TabGroup examples for complete examples.
License
Apache-2.0
