Exclusion Tabs with React Native Skia
Tuesday, August 27, 2024
demos
exclusion-tabs
An ongoing collection of React Native animations crafted with Reanimated, Gesture Handler, and Skia.
TypeScript
3.2k
296
A tab bar component with an exclusion blend effect for tab switching.
What's This About?
This component creates a tab bar that:
Uses blend mode effects
Handles tab switching
Adapts to screen width
Manages active tab state
Usage
type ExclusionTabsProps = {
tabs: string[];
activeTabIndex: number;
onTabChange: (tab: string) => void;
containerWidth: number;
height: number;
};
// Basic usage
const tabs = ['Home', 'Changelog', 'Career', 'About'];
<ExclusionTabs
tabs={tabs}
activeTabIndex={0}
onTabChange={(tab) => {
console.log('Selected tab:', tab);
}}
containerWidth={windowWidth}
height={45}
/>;
// With state management
const [activeTabIndex, setActiveTabIndex] = useState(0);
<ExclusionTabs
tabs={tabs}
activeTabIndex={activeTabIndex}
onTabChange={(tab) => {
setActiveTabIndex(tabs.indexOf(tab));
}}
containerWidth={windowWidth}
height={45}
/>;
Unlock the beauty of React Native animations
Learn Reanimated, Gesture Handler & Skia with Reanimate.dev
Feedback on Exclusion Tabs
Ideas, bugs, or anything that felt off: I read every message. For anything else, write to hello@reactiive.io.
Send feedback