-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Divider] Add support for text-embedded dividers #7597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Generate changelog in
|
✅ Successfully generated changelog entries for:
What happened?Your changelog entries have been stored in the database as part of our migration to ChangelogV3. Need to regenerate?Simply interact with the changelog bot comment again to regenerate these entries. 📋Changelog Preview✨ Features |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for embedding text or other content within dividers, similar to Material UI's Divider component. The feature enables visual separation with contextual labels or section headers while maintaining backward compatibility with existing dividers.
Key Changes:
- Added
childrenandtextAlignmentprops to the Divider component API - Implemented flexbox-based layout with pseudo-elements for line segments
- Added comprehensive test coverage and documentation examples
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/components/divider/divider.tsx | Core implementation adding children and textAlignment props with conditional rendering logic |
| packages/core/src/components/divider/_divider.scss | Styles for text-embedded dividers including flexbox layout, alignment variants, and dark theme support |
| packages/core/test/divider/dividerTests.tsx | Test suite covering text rendering, alignment options, accessibility, and className application |
| packages/core/src/components/divider/divider.md | Documentation explaining the new text embedding feature with alignment options |
| packages/docs-app/src/examples/core-examples/dividerExamples.tsx | Example component registration for the documentation app |
| packages/docs-app/src/examples/core-examples/divider/DividerWithText.tsx | Demo component showcasing all three alignment options |
| packages/docs-app/src/examples/core-examples/divider/DividerWithText.tsx.preview | Preview code snippet for the documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
initBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cleanedBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
renamed test for clarityBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Fixes #7583
Checklist
Changes proposed in this pull request:
This PR adds the ability to embed text or other content within dividers, similar to Material UI's Divider component. This is useful for section headers, labels, or visual separation with context.
New API:
children?: React.ReactNode- Content to embed within the divider (text, icons, etc.)textAlignment?: "left" | "center" | "right"- Controls the position of embedded content (default: "center")Implementation details:
::beforeand::afterpseudo-elements to create line segments on each side of the contentrole="separator"for accessibility when children are presentExample usage:
Reviewers should focus on:
Screenshot
Reference Issue #7583