Skip to content

Commit

Permalink
Merge pull request #412 from WestpacGEL/fixes/breadcrumb-examples
Browse files Browse the repository at this point in the history
Fixes/Breadcrumb examples
  • Loading branch information
samithaf authored Nov 29, 2023
2 parents 73aca8e + 9b3290c commit d0c8547
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 57 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
```jsx
// Using the Link component (as NextLink) from 'next/LinkLink'
<div className="flex flex-col gap-5">
<Breadcrumb aria-label="Page transitions and the such">
// Using the Link component (as NextLink) from 'next/Link'
<div className="flex flex-col gap-4">
<Breadcrumb aria-label="Page transitions and the such" className="px-3 py-1 mt-2">
<NextLink href="#home" passHref legacyBehavior>
<Breadcrumb.Item isCurrent tag="a">Home</Breadcrumb.Item>
</NextLink>
</Breadcrumb>
<Breadcrumb aria-label="Page transitions and the such">
<Breadcrumb aria-label="Page transitions and the such" className="px-3 py-1">
<NextLink href="#home" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Home</Breadcrumb.Item>
</NextLink>
<NextLink href="#personal" passHref legacyBehavior>
<Breadcrumb.Item tag="a" isCurrent>Personal</Breadcrumb.Item>
</NextLink>
</Breadcrumb>
<Breadcrumb aria-label="Page transitions and the such">
<Breadcrumb aria-label="Page transitions and the such" className="px-3 py-1 mb-2">
<NextLink href="#home" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Home</Breadcrumb.Item>
</NextLink>
Expand All @@ -25,23 +25,5 @@
<Breadcrumb.Item tag="a" isCurrent>Credit cards</Breadcrumb.Item>
</NextLink>
</Breadcrumb>
<Breadcrumb>
<NextLink href="#test" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Anchor item</Breadcrumb.Item>
</NextLink>
<NextLink href="#another" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Another anchor item</Breadcrumb.Item>
</NextLink>
<NextLink href="#another" passHref legacyBehavior>
<Breadcrumb.Item isDisabled tag="a">
Disabled item
</Breadcrumb.Item>
</NextLink>
<NextLink href="#another" passHref legacyBehavior>
<Breadcrumb.Item isCurrent tag="a">
Last item
</Breadcrumb.Item>
</NextLink>
</Breadcrumb>
</div>
```
36 changes: 21 additions & 15 deletions apps/site/src/content/design-system/components/breadcrumb/code.mdoc
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
### Default breadcrumb

```jsx
// Using the Link component (as NextLink) from 'next/LinkLink'
<div>
<Breadcrumb>
<NextLink href="#test" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Anchor item</Breadcrumb.Item>
// Using the Link component (as NextLink) from 'next/Link'
<div className="flex flex-col gap-5">
<Breadcrumb aria-label="Page transitions and the such">
<NextLink href="#home" passHref legacyBehavior>
<Breadcrumb.Item isCurrent tag="a">Home</Breadcrumb.Item>
</NextLink>
<NextLink href="#another" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Another anchor item</Breadcrumb.Item>
</Breadcrumb>
<Breadcrumb aria-label="Page transitions and the such">
<NextLink href="#home" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Home</Breadcrumb.Item>
</NextLink>
<NextLink href="#another" passHref legacyBehavior>
<Breadcrumb.Item isDisabled tag="a">
Disabled item
</Breadcrumb.Item>
<NextLink href="#personal" passHref legacyBehavior>
<Breadcrumb.Item tag="a" isCurrent>Personal</Breadcrumb.Item>
</NextLink>
<NextLink href="#another" passHref legacyBehavior>
<Breadcrumb.Item isCurrent tag="a">
Last item
</Breadcrumb.Item>
</Breadcrumb>
<Breadcrumb aria-label="Page transitions and the such">
<NextLink href="#home" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Home</Breadcrumb.Item>
</NextLink>
<NextLink href="#personal" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Personal</Breadcrumb.Item>
</NextLink>
<NextLink href="#credit-cards" passHref legacyBehavior>
<Breadcrumb.Item tag="a" isCurrent>Credit cards</Breadcrumb.Item>
</NextLink>
</Breadcrumb>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
Breadcrumbs come in one style for navigational consistency across all touch-points.

```jsx
// Using the Link component (as NextLink) from 'next/LinkLink'
<Breadcrumb>
<NextLink href="#test" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Anchor item</Breadcrumb.Item>
</NextLink>
<NextLink href="#another" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Another anchor item</Breadcrumb.Item>
</NextLink>
<NextLink href="#another" passHref legacyBehavior>
<Breadcrumb.Item isDisabled tag="a">
Disabled item
</Breadcrumb.Item>
</NextLink>
<NextLink href="#another" passHref legacyBehavior>
<Breadcrumb.Item isCurrent tag="a">
Last item
</Breadcrumb.Item>
</NextLink>
</Breadcrumb>
// Using the Link component (as NextLink) from 'next/Link'
<div className="flex flex-col gap-4">
<Breadcrumb aria-label="Page transitions and the such" className="px-3 py-1 mt-2">
<NextLink href="#home" passHref legacyBehavior>
<Breadcrumb.Item isCurrent tag="a">Home</Breadcrumb.Item>
</NextLink>
</Breadcrumb>
<Breadcrumb aria-label="Page transitions and the such" className="px-3 py-1">
<NextLink href="#home" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Home</Breadcrumb.Item>
</NextLink>
<NextLink href="#personal" passHref legacyBehavior>
<Breadcrumb.Item tag="a" isCurrent>Personal</Breadcrumb.Item>
</NextLink>
</Breadcrumb>
<Breadcrumb aria-label="Page transitions and the such" className="px-3 py-1 mb-2">
<NextLink href="#home" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Home</Breadcrumb.Item>
</NextLink>
<NextLink href="#personal" passHref legacyBehavior>
<Breadcrumb.Item tag="a">Personal</Breadcrumb.Item>
</NextLink>
<NextLink href="#credit-cards" passHref legacyBehavior>
<Breadcrumb.Item tag="a" isCurrent>Credit cards</Breadcrumb.Item>
</NextLink>
</Breadcrumb>
</div>
```

0 comments on commit d0c8547

Please sign in to comment.