import { DemoStory } from '../../demo/demo-types'; import { Breadcrumbs, BreadcrumbsProps } from './breadcrumbs'; import { SvgSvg, SvgPath } from '../svg-props'; const HomeIcon = () => ( ); const FolderIcon = () => ( ); export const breadcrumbsDemo: DemoStory = { id: 'breadcrumbs', text: 'Breadcrumbs', args: { autoCollapse: true, items: [], }, argTypes: { autoCollapse: { control: 'boolean', description: 'Automatically collapse middle items on overflow' }, }, render: (args) => { const longItems = [ { text: 'Home', url: '/', icon: }, { text: 'Settings', url: '/settings', icon: }, { text: 'Account Profile', url: '/account' }, { text: 'Security Preferences', url: '/security' }, { text: 'Two-Factor Auth', url: '/2fa' }, { text: 'Active Sessions' }, ]; const shortItems = [{ text: 'Dashboard', url: '/dashboard' }, { text: 'Overview' }]; return ( Auto-Collapsing Long Breadcrumbs Scale the window (or iframe) down to see the middle sections collapse into an ellipsis `...` Short Breadcrumbs ); }, code: `import { Breadcrumbs } from 'lupine.components/component-pool'; const items = [ { text: 'Home', url: '/' }, { text: 'Settings', url: '/settings' }, { text: 'Account Profile', url: '/account' }, { text: 'Active Sessions' }, // Last item is automatically rendered as current page ]; // Automatically handles overflow and collapse logic naturally via container ResizeObserver `, };
Scale the window (or iframe) down to see the middle sections collapse into an ellipsis `...`