- The EuiAvatar component creates a user icon. It
- will accept name (required) and{' '}
+ The EuiAvatar component typically creates a user
+ icon. It will accept name (required) and{' '}
image props and will configure the display and
accessibility as needed. By default, the background colors come from
the set of colors used for visualizations. Otherwise you can pass a
@@ -123,6 +116,7 @@ export const AvatarExample = {
),
snippet: avatarInitialsSnippet,
demo: ,
+ props: { EuiAvatar },
},
{
title: 'Types',
@@ -148,6 +142,7 @@ export const AvatarExample = {
),
snippet: avatarTypesSnippet,
demo: ,
+ props: { EuiAvatar },
},
{
title: 'Icons',
@@ -164,13 +159,25 @@ export const AvatarExample = {
text: (
- Icons can also be used within avatars and will be sized
- appropriately.
+ Icons can also be displayed instead of initials or images. When
+ simply passing an iconType, it will both size and
+ color appropriately based on the other EuiAvatar{' '}
+ props. To customize these specifically, pass{' '}
+ iconSize and iconColor.
+
+
+ If your icon is multi- or custom-colored like a logo, you can keep
+ the default iconColor by passing{' '}
+ null. Otherwise it will get the appropriate
+ contrast acceptable variant. Just ensure that you also are providing
+ an accesible background color to match that of the icon's
+ color.
),
snippet: avatarIconsSnippet,
demo:
,
+ props: { EuiAvatar },
},
{
title: 'Disabled',
@@ -195,6 +202,7 @@ export const AvatarExample = {
),
snippet: avatarDisabledSnippet,
demo:
,
+ props: { EuiAvatar },
},
],
playground: avatarConfig,
diff --git a/src-docs/src/views/avatar/avatar_icon.js b/src-docs/src/views/avatar/avatar_icon.js
index f7dcc001d05..9f1eb82cdca 100644
--- a/src-docs/src/views/avatar/avatar_icon.js
+++ b/src-docs/src/views/avatar/avatar_icon.js
@@ -1,15 +1,46 @@
import React from 'react';
-import { EuiAvatar } from '../../../../src/components';
+import { EuiAvatar, EuiSpacer, EuiTitle } from '../../../../src/components';
export default () => (
-
+
+ Avatar colors and sizes
+
+
+
-
+
-
+
+
+
+
+
+ Icon colors and sizes
+
+
+
+
+
+
+
+
+
-
);
diff --git a/src-docs/src/views/avatar/avatar_type.js b/src-docs/src/views/avatar/avatar_type.js
index ebff90d87ef..4f26b625234 100644
--- a/src-docs/src/views/avatar/avatar_type.js
+++ b/src-docs/src/views/avatar/avatar_type.js
@@ -1,21 +1,19 @@
import React from 'react';
-import { EuiAvatar } from '../../../../src/components';
+import { EuiAvatar, EuiTitle, EuiSpacer } from '../../../../src/components';
export default () => (
-
+
+ Spaces
+
+
+
-
+
-
+
-
+
);
diff --git a/src/components/avatar/__snapshots__/avatar.test.tsx.snap b/src/components/avatar/__snapshots__/avatar.test.tsx.snap
index e65d86be680..5a5d3a101ea 100644
--- a/src/components/avatar/__snapshots__/avatar.test.tsx.snap
+++ b/src/components/avatar/__snapshots__/avatar.test.tsx.snap
@@ -47,6 +47,53 @@ exports[`EuiAvatar props color is rendered 1`] = `
`;
+exports[`EuiAvatar props iconType and iconColor as null is rendered 1`] = `
+