-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interface guidelines for Breadcrumbs component (#915)
- Loading branch information
1 parent
c5f2d40
commit 8966724
Showing
6 changed files
with
98 additions
and
40 deletions.
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.
Binary file modified
BIN
+260 Bytes
(100%)
apps/docs/content/components/Breadcrumbs/images/do-overflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+301 Bytes
(100%)
apps/docs/content/components/Breadcrumbs/images/dont-overflow.png
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
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,59 @@ | ||
--- | ||
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: Breadcrumbs display the current page within the site's hierarchy, allowing users to easily navigate to a different level. | ||
--- | ||
|
||
import ComponentLayout from '../../../src/layouts/component-layout' | ||
|
||
import {Label} from '@primer/react' | ||
import {BreadcrumbVariants} from '@primer/react-brand' | ||
import {PropTableValues} from '../../../src/components' | ||
|
||
export default ComponentLayout | ||
|
||
```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 | |