Skip to content
v0.9.1
Components

Charts

Charts drawn from a plain HTML table. Put a <table> in a figure.chart with data-momo-chart: momo.js draws it, adds a legend, a tooltip for the pointer and the keyboard, and a Table button. Without JavaScript the table shows, so every value is always readable.

Column

Amounts per period or per group. A single series needs no legend (the title names it) and shows its values on the caps when there is room.

New signupsPer month, 2026
MonthSignups
Jan420
Feb515
Mar610
Apr580
May735
Jun890
<figure class="chart" data-momo-chart="column">
  <figcaption><span class="chart-title">New signups</span><span class="chart-sub">Per month, 2026</span></figcaption>
  <table>
    <thead><tr><th>Month</th><th>Signups</th></tr></thead>
    <tbody>
      <tr><th>Jan</th><td>420</td></tr><tr><th>Feb</th><td>515</td></tr><tr><th>Mar</th><td>610</td></tr>
      <tr><th>Apr</th><td>580</td></tr><tr><th>May</th><td>735</td></tr><tr><th>Jun</th><td>890</td></tr>
    </tbody>
  </table>
</figure>

Grouped columns

Each extra column in the table is a series. Colors come in a fixed order and stay with their series: hide one in the legend and the others keep their color.

Revenue by planThousands, per quarter
QuarterStarterTeamBusiness
Q14288120
Q24897131
Q351110149
Q457126171
<figure class="chart" data-momo-chart="column" data-prefix="$" data-height="220">
  <figcaption><span class="chart-title">Revenue by plan</span><span class="chart-sub">Thousands, per quarter</span></figcaption>
  <table>
    <thead><tr><th>Quarter</th><th>Starter</th><th>Team</th><th>Business</th></tr></thead>
    <tbody>
      <tr><th>Q1</th><td>42</td><td>88</td><td>120</td></tr>
      <tr><th>Q2</th><td>48</td><td>97</td><td>131</td></tr>
      <tr><th>Q3</th><td>51</td><td>110</td><td>149</td></tr>
      <tr><th>Q4</th><td>57</td><td>126</td><td>171</td></tr>
    </tbody>
  </table>
</figure>

Line

Change over time. Each line ends with its value (when the ends are far enough apart), and the pointer gets a crosshair with every series in one tooltip. data-zero="false" lets the axis start near the data instead of at 0.

Weekly retentionShare of users still active
WeekWebiOSAndroid
W1100100100
W2727869
W3617057
W4556649
W5526344
W6506140
W7496038
W8485936
<figure class="chart" data-momo-chart="line" data-suffix="%">
  <figcaption><span class="chart-title">Weekly retention</span><span class="chart-sub">Share of users still active</span></figcaption>
  <table>
    <thead><tr><th>Week</th><th>Web</th><th>iOS</th><th>Android</th></tr></thead>
    <tbody>
      <tr><th>W1</th><td>100</td><td>100</td><td>100</td></tr>
      <tr><th>W2</th><td>72</td><td>78</td><td>69</td></tr>
      <tr><th>W3</th><td>61</td><td>70</td><td>57</td></tr>
      <tr><th>W4</th><td>55</td><td>66</td><td>49</td></tr>
      <tr><th>W5</th><td>52</td><td>63</td><td>44</td></tr>
      <tr><th>W6</th><td>50</td><td>61</td><td>40</td></tr>
      <tr><th>W7</th><td>49</td><td>60</td><td>38</td></tr>
      <tr><th>W8</th><td>48</td><td>59</td><td>36</td></tr>
    </tbody>
  </table>
</figure>

Area

A line with a soft wash under it, for one series where the amount matters.

Active usersDaily, last 14 days
DayUsers
Nov 1612400
Nov 1712950
Nov 1813100
Nov 1912800
Nov 2013600
Nov 2111200
Nov 2210900
Nov 2313900
Nov 2414300
Nov 2514800
Nov 2614650
Nov 2715200
Nov 2812100
Nov 2911800
<figure class="chart" data-momo-chart="area" data-height="180">
  <figcaption><span class="chart-title">Active users</span><span class="chart-sub">Daily, last 14 days</span></figcaption>
  <table>
    <thead><tr><th>Day</th><th>Users</th></tr></thead>
    <tbody>
      <tr><th>Nov 16</th><td>12400</td></tr><tr><th>Nov 17</th><td>12950</td></tr><tr><th>Nov 18</th><td>13100</td></tr>
      <tr><th>Nov 19</th><td>12800</td></tr><tr><th>Nov 20</th><td>13600</td></tr><tr><th>Nov 21</th><td>11200</td></tr>
      <tr><th>Nov 22</th><td>10900</td></tr><tr><th>Nov 23</th><td>13900</td></tr><tr><th>Nov 24</th><td>14300</td></tr>
      <tr><th>Nov 25</th><td>14800</td></tr><tr><th>Nov 26</th><td>14650</td></tr><tr><th>Nov 27</th><td>15200</td></tr>
      <tr><th>Nov 28</th><td>12100</td></tr><tr><th>Nov 29</th><td>11800</td></tr>
    </tbody>
  </table>
</figure>

Stacked

Parts of a total over time. Segments are split by a thin gap (no borders), and the tooltip adds the total.

Tickets by channelPer week
WeekEmailChatPhoneOther
W44120864012
W45132943815
W461181103510
W471011283114
W48961412911
<figure class="chart" data-momo-chart="stacked" data-height="220">
  <figcaption><span class="chart-title">Tickets by channel</span><span class="chart-sub">Per week</span></figcaption>
  <table>
    <thead><tr><th>Week</th><th>Email</th><th>Chat</th><th>Phone</th><th data-other>Other</th></tr></thead>
    <tbody>
      <tr><th>W44</th><td>120</td><td>86</td><td>40</td><td>12</td></tr>
      <tr><th>W45</th><td>132</td><td>94</td><td>38</td><td>15</td></tr>
      <tr><th>W46</th><td>118</td><td>110</td><td>35</td><td>10</td></tr>
      <tr><th>W47</th><td>101</td><td>128</td><td>31</td><td>14</td></tr>
      <tr><th>W48</th><td>96</td><td>141</td><td>29</td><td>11</td></tr>
    </tbody>
  </table>
</figure>

data-other on a heading makes that series gray: use it to fold small series into "Other" instead of adding more colors. There are eight series colors; a ninth series should become "Other" or a second chart.

Bar (ranked list)

Horizontal bars for comparing named things: pages, products, people. Long names get cut with the full name on hover; values sit at the bar ends. Sort the table rows biggest first.

Top pagesVisits this week
PageVisits
/pricing8420
/docs/getting-started6105
/blog/neobrutalism-in-product-design4380
/changelog2950
/careers1210
<figure class="chart" data-momo-chart="bar">
  <figcaption><span class="chart-title">Top pages</span><span class="chart-sub">Visits this week</span></figcaption>
  <table>
    <thead><tr><th>Page</th><th>Visits</th></tr></thead>
    <tbody>
      <tr><th>/pricing</th><td>8420</td></tr>
      <tr><th>/docs/getting-started</th><td>6105</td></tr>
      <tr><th>/blog/neobrutalism-in-product-design</th><td>4380</td></tr>
      <tr><th>/changelog</th><td>2950</td></tr>
      <tr><th>/careers</th><td>1210</td></tr>
    </tbody>
  </table>
</figure>

Sparkline

A tiny trend for stat cards and table rows: <span class="sparkline" data-values="…">. It is drawn in gray with the latest point in the accent. Add data-area for a wash, and .sparkline-block to fill the width.

Monthly revenue $48.2K 12% vs last month

Conversion 4.4%

<div class="stat">
  <span class="stat-label">Monthly revenue</span>
  <span class="stat-value">$48.2K</span>
  <span class="stat-meta"><span class="stat-change is-up"><i class="mi mi-trending-up" aria-hidden="true"></i> 12%</span> vs last month</span>
  <span class="sparkline sparkline-block" data-values="31,34,33,37,36,40,39,42,41,44,46,48" data-area aria-label="Revenue trend, last 12 months: 31K to 48K"></span>
</div>
<p>Conversion <span class="sparkline" data-values="3.1,3.4,3.2,3.8,4.1,3.9,4.4" aria-label="Conversion, last 7 days: 3.1% to 4.4%"></span> <b>4.4%</b></p>

Reading the values

Options

AttributeDoes
data-momo-chartcolumn, bar, stacked, line or area
data-prefix / data-suffixText around every value: $, %, h
data-decimalsDecimal places (default: none for whole numbers, 1 otherwise). Axes past 10,000 switch to 10K style.
data-heightPlot height in pixels (default 240). The axis labels are added below it, never cut.
data-zero="false"Lines and areas: start the axis near the data
data-labelsnone hides value labels; all shows column caps even past 12 columns
td data-valueThe number to draw when the cell shows formatted text ($1.2M)
th data-otherThat series is the gray "Other"

JavaScript

Load new data with Momo.chart.update: it rewrites the table too, so the table view always matches. A series keeps its color when it comes back. While data loads, Momo.chart.loading(fig) fades the old chart instead of flashing.

const fig = document.querySelector('#revenue');
Momo.chart.loading(fig);
const data = await fetch('/api/revenue').then((r) => r.json());
Momo.chart.update(fig, {
  labels: ['Q1', 'Q2', 'Q3', 'Q4'],
  series: [{ name: 'Starter', values: [42, 48, 51, 57] }, { name: 'Team', values: [88, 97, 110, 126] }],
});

Good to know

Start

OverviewStart Getting startedStart CustomizeStart

Guides

AccessibilityGuides BreakpointsGuides ChangelogGuides Customize componentsGuides JavaScriptGuides MotionGuides OptimizeGuides PhonesGuides RebootGuides Right-to-left (RTL)Guides Stacking orderGuides Using Momo with AIGuides

Foundations

ColorsFoundations TypographyFoundations ProseFoundations Images & figuresFoundations CodeFoundations Lines & shadowsFoundations Dark modeFoundations

Forms

Checkbox & switchForms ComboboxForms Date pickerForms Date rangeForms Fields & labelsForms File uploadForms Floating labelsForms Number stepperForms PasswordForms PIN codeForms RatingForms SelectForms SliderForms Tag inputForms Time pickerForms ValidationForms

Components

AccordionComponents Alert & bannerComponents AvatarComponents BadgeComponents BreadcrumbComponents ButtonComponents Button groupComponents CalendarComponents CardComponents CarouselComponents ChartsComponents ChipsComponents CollapseComponents Command paletteComponents CommentsComponents Confirm dialogsComponents Cookie bannerComponents Data tableComponents Description listComponents Dialog & toastComponents DividerComponents DrawerComponents Dropdown menuComponents Empty stateComponents File managerComponents Filter & sortComponents Gallery & lightboxComponents Inbox & chatComponents Infinite scrollComponents KanbanComponents Keyboard shortcutsComponents List groupComponents MarqueeComponents Media objectComponents Nav overflowComponents Notification centerComponents PaginationComponents ProgressComponents Pull to refreshComponents SkeletonComponents SortableComponents SpinnerComponents Split viewComponents Stat cardComponents Steps & wizardComponents Swipe actionsComponents TableComponents TabsComponents TimelineComponents TogglerComponents Tooltip & popoverComponents TourComponents Tree viewComponents VideoComponents WhiteboardComponents

Layout

Announcement barLayout App shellLayout Back to topLayout Container & sectionLayout ExamplesLayout FooterLayout HeroLayout JumbotronLayout Mega menuLayout NavbarLayout Site sidebarLayout

Sections

Bento gridSections Blog cardsSections Call to actionSections Contact & newsletterSections FAQSections FeaturesSections Logo cloudSections PricingSections TeamSections TestimonialsSections

Utilities

OverviewUtilities State variantsUtilities Display & flexUtilities Grid & gapUtilities SpacingUtilities SizingUtilities TextUtilities Links & color strengthUtilities Position & overflowUtilities BackgroundsUtilities Borders & effectsUtilities Transforms & filtersUtilities InteractionsUtilities

Helpers

Fixed, sticky & frostedHelpers Hover & focusHelpers Hover revealHelpers Icon linkHelpers PrintHelpers Relative timeHelpers Screen reader textHelpers Scroll inHelpers ScrollspyHelpers Share buttonHelpers Skip linkHelpers StacksHelpers Stretched linkHelpers Theme toggleHelpers Truncated textHelpers

Page patterns

404 pagePage patterns Coming soonPage patterns Login & registerPage patterns SettingsPage patterns ProfilePage patterns CRM contactsPage patterns ProjectsPage patterns File manager pagePage patterns Billing & plansPage patterns Help centerPage patterns Mobile app screensPage patterns
↑ ↓ moveEnter openEsc close