1.1.5 • Public • Published

Nylas Mailbox

Nylas Mailbox (<nylas-mailbox>) is part of the Nylas Components library that lets you build email/mailbox applications in minutes. Use Nylas Mailbox with your Nylas account or by passing in your own JSON data.

Nylas Mailbox is currently in active development. Want to contribute? Find out how!

Nylas Mailbox

Table of Contents


In your JavaScript application, you can install Nylas Mailbox with:

  • npm npm i @nylas/components-mailbox
  • Yarn yarn add @nylas/components-mailbox

Alternatively, on an html page, you can load the Mailbox using a script tag:

      <!-- Import the script from CDN -->
      <script src="https://unpkg.com/@nylas/components-mailbox"></script>

For both installation options, in the body of your page, you can instantiate the mailbox component with <nylas-mailbox></nylas-mailbox>.

Using It in Your App

All Nylas components have two ways of displaying data to your end-user:

  1. Fetching data directly from Nylas
  2. Passing in your own data

Fetching data directly from Nylas


If you haven't registered for a Nylas account yet, you can do so at dashboard.nylas.com. Once there, head to the Components tab and create a new Mailbox component.

You'll be guided through the component setup and be given the options to customize your mailbox component. Review the Mailbox Documentation.

Allowed domains

During the setup process, you'll be prompted to provide a list of allowed domains. Be sure to add any domains you'll be testing your app on, including localhost, and any staging and production URLs you might use.

Passing in your own data

Nylas Mailbox can be used as a UI on top of any threads data that you provide. Threads should follow the Nylas thread object standard.

The property to use for this is all_threads. You can pass in a JSON array of threads.

  const staticThreads = [
            {"email":"phil.r@nylas.com","name":"Phil Renaud"},
            {"email":"review_requested@noreply.github.com","name":"Review requested"}
            {"email":"notifications@github.com","name":"Mostafa Rashed"}
          "snippet":"Hi, Welcome to Nylas",
          "subject":"Hello from Nylas",
      "snippet":"Hi, Welcome to Nylas",
      "subject":"Hello from Nylas",

Then pass the array into your component using any JavaScript.

<nylas-mailbox all_threads={staticThreads}>

You can also use plain JavaScript as an attribute.

document.querySelector("nylas-mailbox").all_threads = staticThreads;


Nylas Mailbox allows for several properties that affect the layout and functionality of your component. You can find a complete list of properties within our Documentation for Nylas Mailbox

Events and Callbacks

You can listen to certain user events from your application by adding an event listener to your component.

For example, you can listen for a threadClicked event with the following code:

  .addEventListener("onStarSelected", (event) => {
    let { detail } = event;
    console.log("star selected: ", detail);

A list of emitted events is available on our Documentation for Nylas Mailbox


Please refer to our Contributing Guidelines for information about how to get involved. We welcome bug reports, questions, and pull requests.

  1. Git clone git@github.com:nylas/components.git
  2. Run yarn install
  3. Run yarn start; your browser will load http://localhost:8000 and show you a list of available running components


yarn cy:open will launch our end-to-end tests in a browser tests will automatically be run on push from push.yaml

Additional Documentation




Package Sidebar


npm i @nylas/components-mailbox

Weekly Downloads






Unpacked Size

717 kB

Total Files


Last publish


  • b3ndoi
  • krisgardiner
  • nylas-admin
  • poojaguggari
  • sourcesoft
  • ozsivanov
  • mrashed-dev