Conversation
Add initial Breadcrumbs component skeleton with proposed API, Storybook stories, and basic tests for RFC review. Made-with: Cursor
Refactor the StyledLink component to enhance hover effects and ensure consistent text color based on theme. This improves accessibility and visual feedback for users.
|
📚 Storybook Preview Deployed✅ Preview URL: https://click-l7f6c1h0i-clickhouse.vercel.app Built from commit: |
punkbit
left a comment
There was a problem hiding this comment.
@elizabetdev mind include a changeset? Add a short description explaining how to use the component.
Ref:
https://github.com/ClickHouse/click-ui?tab=readme-ov-file#add-a-new-changeset
Summary
Breadcrumbs navigation component that displays the user's current location within a hierarchy, allowing quick navigation to parent pages. Supports icons, auto-collapsing middle items into an ellipsis dropdown, and active page indication.
Component name:
BreadcrumbsType: New Component
Motivation
Why is this component needed, or why does the existing one need to change?
Design reference
Proposed API
Show the intended public API with usage examples.
Basic usage — all items visible
Separators are auto-inserted between items.
Collapsed — middle items hidden behind ellipsis dropdown
When
maxItemsis set and the item count exceeds it, middle items collapse into a...button. Clicking the ellipsis opens a popover dropdown listing the hidden items.Fine-grained collapse control
Responsive usage
The consumer handles responsive behavior externally:
Props
BreadcrumbsPropschildrenReactNodeBreadcrumbItemelementsmaxItemsnumberundefinedundefined, all items are shownitemsBeforeCollapsenumber1itemsAfterCollapsenumber1separatorReactNode<Icon name="chevron-right" />BreadcrumbItemPropschildrenReactNodeiconIconNameundefinedactivebooleanfalsehrefstringundefinedCollapse behavior
maxItemsitemsBeforeCollapseitemsAfterCollapseundefined211...+ last421...+ last211classNameandrefforwardingVariants & states
List the variants and states the component should support:
docs.typography.breadcrumbstokens)Accessibility
<nav>,<ol>,<li>,<a>)aria-label="Breadcrumb",aria-current="page"on active item)Theming
src/theme/tokens(no hardcoded colors, spacing, or font sizes)theme.click.docs.typography.breadcrumbs.default— link itemstheme.click.docs.typography.breadcrumbs.active— current page itemtheme.click.global.color.text.muted— link item colortheme.click.global.color.text.default— active item colortheme.click.genericMenu.*— ellipsis dropdown stylingImplementation checklist
src/components/Breadcrumbs/Breadcrumbs.tsxsrc/components/index.tsstyled-componentsusing theme tokensanytypes usedTesting
Breadcrumbs.test.tsxtoHaveAccessibleName)Breadcrumbs.stories.tsxDocumentation
Changeset
yarn changeset:addhas been run and the changeset file is includedminorfor new components,patchfor changes/fixes)Security checklist
dangerouslySetInnerHTMLRollout & migration (for component changes only)
N/A — new component.
Open questions
List any unresolved decisions or areas where you'd like reviewer feedback.
BreadcrumbItemaccept anasprop (e.g., for React RouterLinkintegration)?Popoveror a custom implementation?maxItemssupport a responsive object like{ sm: 2, md: 4 }?Preview
Link to a deployed Storybook preview or attach screenshots.
Storybook preview will be available once CI deploys.