UNPKG

@ramses-superapp/ramses-ui

Version:

Skinless UI primitives for Ramses Built Apps

35 lines (34 loc) 845 B
"use strict"; import { forwardRef } from 'react'; import { Pressable, Text, View } from 'react-native'; import { jsx as _jsx } from "react/jsx-runtime"; const RsTabBar = /*#__PURE__*/forwardRef(({ tabs, activeTab, onTabChange, style }, ref) => { return /*#__PURE__*/_jsx(View, { ref: ref, style: [{ flexDirection: 'row' }, style], children: tabs.map(tab => /*#__PURE__*/_jsx(Pressable, { onPress: () => onTabChange(tab.key), accessibilityRole: "tab", accessibilityState: { selected: tab.key === activeTab }, style: { flex: 1, alignItems: 'center' }, children: /*#__PURE__*/_jsx(Text, { children: tab.label }) }, tab.key)) }); }); RsTabBar.displayName = 'RsTabBar'; export default RsTabBar; //# sourceMappingURL=RsTabBar.js.map