-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add interface guidelines for Breadcrumbs component #915
Open
danielguillan
wants to merge
8
commits into
main
Choose a base branch
from
danielguillan/add-breadcrumbs-interface-guidelines
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ad818eb
Rename current docs file to react
danielguillan 64053b3
Add interface guidelines
danielguillan fd852ba
Remove redundant accessibility section from React docs
danielguillan 4c05769
Merge branch 'main' into danielguillan/add-breadcrumbs-interface-guid…
danielguillan f147364
Update apps/docs/content/components/Breadcrumbs/index.mdx
danielguillan fb2205e
Update apps/docs/content/components/Breadcrumbs/index.mdx
danielguillan 95232fb
Update apps/docs/content/components/Breadcrumbs/react.mdx
danielguillan f227492
Add missing exports component layout
danielguillan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
danielguillan marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
title: Breadcrumbs | ||
source: https://github.com/primer/brand/tree/main/packages/react/src/Breadcrumbs/Breadcrumbs.tsx | ||
storybook: '/brand/storybook/?path=/story/components-breadcrumbs--playground' | ||
description: Use breadcrumbs to enable wayfinding through navigational links | ||
danielguillan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
--- | ||
|
||
import {Label} from '@primer/react' | ||
import {BreadcrumbVariants} from '@primer/react-brand' | ||
import {PropTableValues} from '../../../src/components' | ||
|
||
```js | ||
import {Breadcrumbs} from '@primer/react-brand' | ||
``` | ||
|
||
## Examples | ||
|
||
### Default | ||
|
||
```jsx live | ||
<Breadcrumbs> | ||
<Breadcrumbs.Item href="/">Resources</Breadcrumbs.Item> | ||
<Breadcrumbs.Item href="/copilot">GitHub Copilot</Breadcrumbs.Item> | ||
<Breadcrumbs.Item href="/copilot/chat" selected> | ||
Chat | ||
</Breadcrumbs.Item> | ||
</Breadcrumbs> | ||
``` | ||
|
||
### Accent | ||
|
||
```jsx live | ||
<Breadcrumbs variant="accent"> | ||
<Breadcrumbs.Item href="/">Resources</Breadcrumbs.Item> | ||
<Breadcrumbs.Item href="/copilot">GitHub Copilot</Breadcrumbs.Item> | ||
<Breadcrumbs.Item href="/copilot/chat" selected> | ||
Chat | ||
</Breadcrumbs.Item> | ||
</Breadcrumbs> | ||
``` | ||
|
||
## Component props | ||
|
||
### Breadcrumbs <Label>Required</Label> | ||
|
||
| name | type | default | required | description | | ||
| --------- | ------------------------------------------------------------- | ------- | -------- | ----------------------------------------- | | ||
| `variant` | <PropTableValues values={BreadcrumbVariants} addLineBreaks /> | | `false` | Specify alternative breadcrumb appearance | | ||
|
||
### Breadcrumbs.Item <Label>Required</Label> | ||
|
||
| name | type | default | required | description | | ||
| ---------- | --------- | ------- | -------- | ----------------------------------- | | ||
| `selected` | `boolean` | | `false` | Used for indicating the active link | | ||
| `href` | `string` | | `true` | URL of the page the link goes to | |
Oops, something went wrong.
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.
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.
Real nit here, sorry...
In the docs, this almost looks like a 404 image showing alt text 😄
👇
@danielguillan do you think we can either center the breadcrumbs or put it on a gray background like the images below?