-
Notifications
You must be signed in to change notification settings - Fork 526
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
PageHeader: Add docs to primer.style and features to Storybook #2694
Conversation
🦋 Changeset detectedLatest commit: 55cfa00 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
import {PageHeader} from '@primer/react' | ||
``` | ||
|
||
## Examples |
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.
I'd restructure the sections to follow what we have for the other components (for example, ActionList):
## Examples
### With a title
### With a title and actions
<!-- all other examples -->
## Props
### PageHeader
Optional description of the component
<PropsTable>
<!-- props table content -->
</PropsTable>
### PageHeader.ContextArea
Optional description of the component
<PropsTable>
<!-- props table content -->
</PropsTable>
<!-- all other child elements -->
docs/content/drafts/PageHeader.mdx
Outdated
|
||
## Examples | ||
|
||
### Anotomy of PageHeader |
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.
Instead of trying to explain the usage details of PageHeader components in the API docs, this should be covered in PageHeader interface guidelines in https://primer.style/design/. Sadly, we don't have these written yet.
When we provide a thorough set of examples, engineers can see how the parts of a PageHeader are meant to be used in live demos.
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.
Here's what I'd recommend as a thorough set of examples:
## Examples
### Just has a title
### Title variant="large"
### Title with leading and trailing visuals
### With actions
### With description slot
### With navigation slot
### With a ContextArea with all possible children (only visible on mobile)
### With a ContextArea with all possible children (always visible)
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.
Thank you so much @mperrotti! This is great. You are right, the initial structure I was thinking is more of an interface guideline content not so much API docs. I updated the docs accordingly and added storybook features as well. Looking forward to hearing your thoughts 🙌🏼
f3b89a5
to
f0089e3
Compare
54b91bf
to
da19d41
Compare
* PageHeader: Docs structure * Add descriptions to children * Add features to storybook * update NavList snapshots * remove component export from the main bundle * update snapshots
* PageHeader: Docs structure * Add descriptions to children * Add features to storybook * update NavList snapshots * remove component export from the main bundle * update snapshots
Closes #1570
This PR adds mdx documentation for PageHeader and export the component in the draft bundle
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.