-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
now EuiBadge renders anchor tags too (#3009)
* fixed errors * updated changelog * Update CHANGELOG.md * added preview in docs-section * Update CHANGELOG.md * added example file * Fixing anchor and disabled styles, updating example (#2) Thanks @cchaos * added tests * Update CHANGELOG.md Co-Authored-By: Caroline Horn <549577+cchaos@users.noreply.github.com> Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
- Loading branch information
1 parent
a8a4063
commit 8ea32fe
Showing
8 changed files
with
189 additions
and
19 deletions.
There are no files selected for viewing
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
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,38 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
EuiBadge, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
} from '../../../../src/components'; | ||
|
||
export default () => ( | ||
<EuiFlexGroup wrap responsive={false} gutterSize="xs"> | ||
<EuiFlexItem grow={false}> | ||
<EuiBadge color="#BADA55" href="/#/display/badge"> | ||
badge as an anchor | ||
</EuiBadge> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiBadge color="hollow" href="/#/display/badge" target="blank"> | ||
anchor with target specified | ||
</EuiBadge> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiBadge | ||
color="accent" | ||
href="/#/display/badge" | ||
iconType="bolt" | ||
iconSide="right" | ||
iconOnClick={() => window.alert('Icon inside badge clicked')} | ||
iconOnClickAriaLabel="Example of onClick event for icon within the anchor"> | ||
anchor with an icon and iconOnClick | ||
</EuiBadge> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiBadge color="secondary" href="/#/display/badge" isDisabled={true}> | ||
disabled anchor badge | ||
</EuiBadge> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); |
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
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