feat(PageHeader): add Lucide icon selector and iconAlign prop#69
Merged
Conversation
Stories improvements: - Add interactive icon dropdown control with 15 Lucide React icons (Home, Settings, User, Users, Calendar, FileText, Building, Briefcase, Chart, Shield, Bell, Search, Stethoscope, Hospital, ClipboardList) - Add iconAlign radio control to toggle between 'top' and 'center' - Disable controls for ReactNode props (actions, children) to prevent Storybook serialization errors Component enhancements: - Add iconAlign prop with 'top' | 'center' options (default: 'center') - When iconAlign='top', icon aligns with the top of title/subtitle instead of vertically centering - Adds subtle mt-1 offset when top-aligned for better visual balance
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the PageHeader component with configurable icon alignment and upgrades its Storybook stories with a Lucide icon selector and safer controls for ReactNode props.
Changes:
- Add an
iconAlignprop ('top' | 'center', default'center') toPageHeaderand adjust layout classes so the icon can align with the title top or be vertically centered, including a subtlemt-1offset when top-aligned. - Extend the PageHeader Storybook story with a selectable set of 15 Lucide icons via a mapped
iconcontrol and aniconAlignradio control. - Disable
actionsandchildrenStorybook controls to avoid serialization errors for ReactNode props.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/components/PageHeader/PageHeader.tsx |
Adds the iconAlign prop and conditionally applies flex alignment and margin classes to support top vs center icon alignment. |
src/components/PageHeader/PageHeader.stories.tsx |
Introduces a Lucide icon registry and Storybook icon select control, adds an iconAlign radio control, and disables actions/children controls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stories improvements:
Component enhancements:
page-header.mov