[EuiBreadcrumb] Extend HTMLElement and EuiLink.color & [EuiPageHeader] Adding breadcrumbs as an option#5634
Conversation
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/ |
breadcrumbs as an optionHTMLElement and EuiLink.color & [EuiPageHeader] Adding breadcrumbs as an option
cchaos
left a comment
There was a problem hiding this comment.
This PR is ready for review. I didn't point it to the EuiPageTemplate feature PR because it's not really dependent on any of that work.
Also, I do need some help in a couple of places.
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/ |
elizabetdev
left a comment
There was a problem hiding this comment.
LGTM! 🎉
Tested in Chrome, Safari, Edge, and Firefox.
| const breadcrumbs: EuiBreadcrumb[] = [ | ||
| { | ||
| text: 'Animals', | ||
| href: '#', | ||
| color: 'primary', | ||
| onClick: (e: { preventDefault: () => void }) => { | ||
| e.preventDefault(); | ||
| }, | ||
| }, | ||
| { | ||
| text: 'Reptiles', | ||
| color: 'primary', | ||
| }, | ||
| { | ||
| text: ( | ||
| <> | ||
| <EuiIcon type="alert" size="s" /> Boa constrictor | ||
| </> | ||
| ), | ||
| title: 'Boa constrictor has an error', | ||
| href: '#', | ||
| color: 'danger', | ||
| onClick: (e: { preventDefault: () => void }) => { | ||
| e.preventDefault(); | ||
| }, | ||
| }, | ||
| { | ||
| text: 'Edit', | ||
| }, | ||
| ]; |
There was a problem hiding this comment.
Maybe you can provide a better real-world example.
There was a problem hiding this comment.
Is animal classification not real world? 🤣
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/ |
Co-authored-by: Greg Thompson <thompson.glowe@gmail.com>
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/ |
1 similar comment
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5634/ |
EuiBreadcrumbs
Each EuiBreadcrumb now extends a basic
HTMLElementin order to customize thetitlefor indicating things like alerts, as well ascolorfrom EuiLink (but only if rendering as an EuiLink otherwise it stays subdued).EuiPageHeader
I've been seeing more and more patterns of folks introducing breadcrumbs, or at the very least a "Return" link, to the top of the page header. This PR adds this ability directly into
EuiPageHeadervia a newbreadcrumbsprop.Checklist
[ ] Checked for breaking changes and labeled appropriately