Only show these results:

Contact List Component

Use Contact List to display your Contacts in a sortable, interactive list. Without needing to write a line of code, Contact List comes with:

  • Display picture
  • Contact Email
  • Last date emailed
  • Sortable list
  • Customization
Nylas Contact List


  1. Create a Contact List component in your Nylas Dashboard.
  2. Add it to your application.
<!-- Import the script from CDN -->
<script src=""></script>
<!-- Place the component on the page -->
<nylas-contact-list id="<PASTE_YOUR_COMPONENT_ID>"></nylas-contact-list>

That’s It! Contact List is ready to use!


  • Either an existing Nylas application or sign up using our Quickstart.
  • If using an existing application, make sure you have the minium required scopes.
    • Agenda - calendar
    • Composer - email.modify, email.send,and contacts
    • Contact List - contacts
    • Email - email.modify,email.folders_and_labels, and contacts
    • Messages - email.read_only and contacts
  • An application to add the Component to. You can fork one of the many CodeSandboxes in the documentation.

Contact List Installation Options

You can install Contact List in 2 ways:

npm Package

  1. Run npm i @nylas/components-contact-list or yarn add @nylas/components-contact-list.
  2. Then import and render the component.
    // Import the web component
import '@nylas/components-contact-list';

// In render method

Script Tag

Use the CDN script tag,

<!-- Import the script from CDN -->
<script src=""></script>
<!-- Place the component on the page -->

Ways to Use Contact List

You'll learn how to use your Nylas accounts with the Contact List Component.

Use Contact List Component with Nylas Data

You'll learn how to use your Nylas accounts with the Contact List Component.

Create the Contact List Component

  1. Log in to your Nylas dashboard.
  2. Click Components > Contact List
  3. Name your Component and select the account.
  4. Use an existing access token or generate a new one. To quickly start testing your Component select Enable for a single account.
    1. To learn how to enable components for multiple accounts see Authorizing Components
  5. Enter the domain the component will run on. Without the domains, the component will not run.
  6. Save your new Component.
  7. On the Edit page, you can configure your component behavior and appearance.

Generate an Access Token

Generating a new access token will not replace your existing access token; it will create a second access token with the same scopes as the previous token. You can revoke access tokens at any time.

Nylas Contact Create

Add the Component To Your Application

  1. On the Edit page, there are instructions for installing the new Component.

  2. If you haven't installed the Contact List Component already, open a terminal and run npm i @nylas/components-contact-list.

  3. Then add your Nylas Component. Copy and paste your component code into your application.

    Nylas Contact npm
  4. You should refresh your application if needed. Any customization options set on the editing page will apply to your Component.

If you want to get started without installing the components in your application, fork this CodeSandbox and replace the ID with your Contact List ID.

Contact List CodeSandbox

The application uses demo data. Create a new Component so you can use your data.

Use Contact List with External Data

You'll learn how to pass in an contacts array and display an contact list within your application.

Create the Contact List Component

  1. Install the Nylas Contact List Component. npm i @nylas/components-contact-list.

The Nylas Contact List Component can accept an array of objects for contacts.

You can pass in:

  • email - Emails must be unique for each contact.
  • given_name - Full contact name
import ContactList from "@nylas/components-contact-list";
const staticContacts = [
emails: [
email: "[email protected]"
given_name: "Thomas Edison"
emails: [
email: "[email protected]"
given_name: "Alexander Graham Bell"
emails: [
email: "[email protected]"
given_name: "Albert Einstein"

main {
font-family: sans-serif;
text-align: center;
height: 800px;

<h1>Nylas Contact List</h1>
<nylas-contact-list contacts={staticContacts}/>

Contact List External Data Example

If you want to get started quickly, grab a copy of our CodeSandbox to get started. The application uses demo data. Create a new Component when you're ready to use your data.

Authorizing Components

With components, you can authorize them to work with a single account or multiple accounts.

Enable for a Single Account

A single account is a way to get started quickly. If you use this method in production, you'll have to authenticate each account from the dashboard one by one.

Enable components single account

Enable for All Accounts

To enable all accounts, you'll need to pass in a user's access token as a property of the component. One way to achieve this is to create a login screen, capture the access token and pass it into the component. You can pass in access_tokens directly in the Component.

<nylas-agenda id="COMPONENT-ID" access_token="USER-ACCESS-TOKEN"/>

Make sure to keep access_tokens hidden and never expose them online.

Enable Components for all accounts

Dashboard Preview

Dashboard previews do not work when enabling for all accounts.


Customize your Contact List with these properties.

Property Value Description
click_action select, email Default, select, set the behavior when clicking on contacts. For email , clicking a contact attempts to open the email program
sort_by name, last_emailed Default name, sort contacts by last name. last_emailed also requires email scopes to sort by date
contacts_to_load 10, 50 , 100, 1000 Default 100, number of contacts to display
theme theme-1, theme-2, theme-3, theme-4 Default theme-1, set the theme

Contact List Event Listeners

Name Description
manifestLoaded This event is dispatched on load when the manifest is loaded. The handler is passed the manifest argument.
onError Emitted if an error occurs while fetching data in the component. The handler is passed an object with the component id as the key and the error as the value.
contactClicked Emitted when contact is clicked. Returns the KeyboardEvent or MouseEvent as event, contact clicked and the list of contacts.

Allowed Domains

You can restrict the domains that your Component works on. Use glob patterns to enable or disable domains.

Some examples of glob patterns:

  • will only match
  • will match
  • * will match and
  • * will match any domain

Domain restriction only applies to the domain name. URL paths (/sub-path) or protocols (HTTPS) can not be restricted.

How Properties Are Handled

Nylas Components follow an order of operations to decide if the dashboard or code takes precedence.

  1. If the property is passed directly to the Component, use that first.
  2. If the property is not passed directly in the Component, use the dashboard settings.
  3. If there are no properties set in the Component or the dashboard, use the Component defaults.

Contact List Data

The Contact List Component pulls from the /contact endpoint. It displays:

  • Name
  • Photo if available. If there is no photo available, it defaults to showing the contact initials.
  • Last Emailed Date
  • Email

Demo Apps

Fork our demo to get started.

What's Next?

Take a look at other Components:

Check us out on GitHub: