Skip to contentSkip to navigationSkip to topbar
Paste assistant Assistant
Figma
Star

User Dialog

Version 2.1.1GithubStorybook

User dialog is a menu that contains user profile-related actions.

Installation

Installation page anchor
yarn add @twilio-paste/user-dialog - or - yarn add @twilio-paste/core
import {UserDialog} from '@twilio-paste/core/user-dialog';

const UserDialogExample = () => {
  const userDialogList = useUserDialogListState();
  return (
    <UserDialogContainer name="Nora Krantz">
      <UserDialog aria-label="my_user_menu">
        <UserDialogUserInfo>
          <UserDialogUserName>Name</UserDialogUserName>
          <UserDialogUserEmail>email@email.com</UserDialogUserEmail>
        </UserDialogUserInfo>
        <UserDialogList {...userDialogList} aria-label="User menu actions">
          <UserDialogListItem {...userDialogList} onSelect={() => {}}>One</UserDialogListItem>
          <UserDialogListItem {...userDialogList} href="www.#.com">Two</UserDialogListItem>
        </UserDialogList>
      </UserDialog>
    </UserDialogContainer>
  );
};

UserDialog

UserDialog page anchor

aria-label RequiredRequired

Accessible label for the User Dialog

Type
string

element

Overrides the default element name to apply unique styles with the Customization Provider.

Type
any
Default
USER_DIALOG

name RequiredRequired

Provides name for the Avatar initials

Type
string

icon

Provides an icon for the Avatar

Type
FC<any>

src

Provides an image for the Avatar

Type
string

state

useUserDialog state hook return value

Type
any

UseUserDialogStateReturn

UseUserDialogStateReturn page anchor

element

Overrides the default element name to apply unique styles with the Customization Provider.

Type
any
Default
USER_DIALOG_USER_INFO

element

Overrides the default element name to apply unique styles with the Customization Provider.

Type
any
Default
USER_DIALOG_USER_NAME

element

Overrides the default element name to apply unique styles with the Customization Provider.

Type
any
Default
USER_DIALOG_USER_EMAIL

aria-label RequiredRequired

Accessible description of the list

Type
string

element

Overrides the default element name to apply unique styles with the Customization Provider.

Type
any
Default
USER_DIALOG_LIST

UseUserDialogListStateReturn

UseUserDialogListStateReturn page anchor

element

Overrides the default element name to apply unique styles with the Customization Provider.

Type
any
Default
USER_DIALOG_LIST_ITEM

href

Providing an href will make the list item an <a> tag

Type
string