Skip to content

User ​

catnip-user displays a person as the compact avatar chip from the Catnip design language. Pass the person through name. Initials are derived from that name unless you set initials. Avatar color defaults to purple and can be overridden with color.

It is not a select field: there is no options list. interactive chooses whether the chip is a control:

  • false (default) — avatar + name, or avatar only when hideName, with no action.
  • true with interaction="click" (default when interactive) — pill button, no chevron.
  • true with interaction="expand" — pill + chevron button. Put it in Dropdown’s trigger slot when the person must be selectable.

Override the circle with the avatar slot (photo, SVG, or other content). The default slot overrides the visible name; name still drives initials and Unassigned.

Live example ​

vue
<catnip-dropdown hide-label dropdown-aria-label="Choose a person" .modelValue="name || 'unassigned'" @update:modelValue="onSelect">
  <catnip-user slot="trigger" interactive interaction="expand" .name="name" .color="color" />
  <catnip-dropdown-option value="unassigned" label="Unassigned">
    <catnip-user />
  </catnip-dropdown-option>
  <catnip-dropdown-option value="Name Surname" label="Name Surname">
    <catnip-user name="Name Surname" />
  </catnip-dropdown-option>
</catnip-dropdown>

<catnip-user name="Name Surname" />
<catnip-user .hideName="true" name="Name Surname" />
<catnip-user interactive interaction="click" name="Name Surname" />
<catnip-user name="Some Person" color="#037257" />
<catnip-user interactive interaction="expand" name="Name Surname" initials="AB" disabled />

<catnip-user name="Name Surname">
  <img slot="avatar" src="/avatar.jpg" alt="" />
  Display name
</catnip-user>

Initials ​

  • Two or more words: first letter of the first two words (Name Surname → NS).
  • One word: first two letters (Madonna → MA).
  • Set initials when the derived value is not what you want. Only the first two characters are shown.

An empty name shows the bundled user.unassigned copy with the built-in user icon. Set unassignedLabel to override that string on one instance. A slotted avatar replaces that icon. When using User as a Dropdown trigger, update name and color from the same selected person so the trigger avatar matches its option-row avatar.

Guidelines ​

When to use ​

Use catnip-user for compact assignee, owner, reviewer, or account identity.

ModeWhen
StaticTables and summaries that must not imply an action. Default (interactive off). Use hideName when only the circle should show.
ExpandAssignee / owner picker. Pill + chevron — set interactive with interaction="expand" and compose as Dropdown’s trigger.
ClickSame pill as expand, no chevron (interaction="click"). A button for account / profile actions that are not a person picker.

selected is the open appearance while a menu is showing. If you compose with Dropdown, the host aria-expanded already turns that style on — including rotating the chevron when interaction is expand — you do not have to bind selected unless you own the menu yourself.

vue
<catnip-dropdown hide-label dropdown-aria-label="Choose a person" .modelValue="name || 'unassigned'" @update:modelValue="onSelect">
  <catnip-user slot="trigger" interactive interaction="expand" .name="name" .color="color" .disabled="isLocked" />
  <catnip-dropdown-option value="unassigned" label="Unassigned">
    <catnip-user />
  </catnip-dropdown-option>
  <catnip-dropdown-option value="Name Surname" label="Name Surname">
    <catnip-user name="Name Surname" />
  </catnip-dropdown-option>
</catnip-dropdown>

<script setup>
import { ref } from "vue";

const people = [
  { value: "unassigned", name: "", color: "" },
  { value: "Name Surname", name: "Name Surname", color: "" }
];
const name = ref("");
const color = ref("");
const isLocked = false;

function onSelect(event) {
  const value = event.detail[0];
  const selected = people.find((person) => person.value === value) ?? people[0];
  name.value = selected.name;
  color.value = selected.color;
}
</script>

Dropdown option value cannot be an empty string, so use a sentinel such as unassigned and map it to an empty name. Update the trigger's name and color from the same selected person so its avatar matches the option row. Keep option-row users non-interactive (the default): the open list clones slot markup, so interactive users inside options would not stay interactive. Pass name / color as attributes as well as properties so those clones still show the right person.

Name and initials ​

  • Pass the complete visible person through name.
  • An empty name is Unassigned (user icon + bundled user.unassigned). Override with unassignedLabel for product-specific copy; app-wide language goes through registerTranslate.
  • Let the component derive initials unless a product-specific short form is required.
  • Override with initials for nicknames, monograms, or languages where first-two-word initials are wrong. Longer values are clipped to two characters.
  • The default slot overrides the visible name only. Keep name in sync so initials and Unassigned stay correct.

Avatar slot ​

  • Use the avatar slot for a photo, SVG, or other custom circle content. Initials remain the default when the slot is empty.
  • Unassigned still uses the built-in user icon unless you slot a custom avatar.

Color ​

  • The default assigned avatar fill is the purple data color (--catnip-color-data-1).
  • Pass color when a specific person needs a stable custom fill (Figma Assigned 2–6 are the other data colors).
  • Unassigned always uses the fixed neutral avatar fill.
  • Disabled greys the avatar regardless of color.

Vue custom-element binding ​

Use leading-dot camelCase property binding for reactive values:

vue
<catnip-user
  .name="person.name"
  .initials="person.initials"
  .color="person.color"
  .interactive="canAssign"
  interaction="expand"
  .selected="menuOpen"
  .hideName="compact"
  .disabled="isLocked"
>
  <img v-if="person.avatarUrl" slot="avatar" :src="person.avatarUrl" alt="" />
</catnip-user>

Catnip Design System by Signicat