TabbedChips (Alpha)
A chip component commonly used in filter context to refine a date source@coinbase/cds-web@8.38.5
Alpha componentAlpha components are stable and safe to use. They allow us to provide new and powerful features quickly, without forcing breaking changes. Components will exit the alpha status when their deprecated counterpart is removed in the next major version.
import { TabbedChips } from '@coinbase/cds-web/alpha/tabbed-chips/TabbedChips'
Related components
Basic usage
Loading...
Live Codefunction ExampleDefault() { const tabs = [ { id: 'all', label: 'All' }, { id: 'swap', label: 'Swap' }, { id: 'collect', label: 'Collect' }, { id: 'bridge', label: 'Bridge' }, ]; const [activeTab, setActiveTab] = useState(tabs[0]); return <TabbedChips activeTab={activeTab} onChange={setActiveTab} tabs={tabs} />; }
Compact
function ExampleCompactNoStart() {
const tabs = [
{ id: 'all', label: 'All' },
{ id: 'swap', label: 'Swap' },
{ id: 'collect', label: 'Collect' },
{ id: 'bridge', label: 'Bridge' },
];
const [activeTab, setActiveTab] = useState(tabs[0]);
return <TabbedChips activeTab={activeTab} compact onChange={setActiveTab} tabs={tabs} />;
}
Many tabs (paddles)
Paddles & overflow
Paddles appear automatically when the tab list overflows.
Loading...
Live Codefunction ExampleWithPaddles() { const tabs = Array.from({ length: 12 }).map((_, i) => ({ id: `tab_${i + 1}`, label: `Tab ${i + 1}`, })); const [activeTab, setActiveTab] = useState(tabs[0]); return <TabbedChips activeTab={activeTab} onChange={setActiveTab} tabs={tabs} />; }