TabIndicator
A visual indicator that shows the active tab position.@coinbase/cds-web@8.13.6
ImportSourceView source codeStorybookView Storybook
import { TabIndicator } from '@coinbase/cds-web/tabs/TabIndicator'
Peer dependencies
- framer-motion: ^10.18.0
Related components
Basic Example
Loading...
Live Codefunction TabIndicatorExample() { const getRandomNumber = () => Math.random() * 100 + 100; const [width, setWidth] = useState(120); const [x, setX] = useState(120); const handlePress = () => { setWidth(getRandomNumber()); setX(getRandomNumber()); }; return ( <VStack padding={4} gap={2} background="bg"> <Button onClick={handlePress} block> Randomize </Button> <TabIndicator width={width} x={x} /> </VStack> ); }