Skip to content
v0.9.1
Components

Chips

Small pieces for people, places, tags and choices. A chip can carry an icon or an avatar, be removed, or be pressed like a filter.

Basic

.chip on a <span>. Put a Moey icon or an avatar first; paint it with .bg-<color> or .bg-<color>-soft.

Design Lisbon AKAna Kim Featured In stock Sold out
<div class="chip-group" id="ch-basic">
  <span class="chip">Design</span>
  <span class="chip"><i class="mi mi-map-pin" aria-hidden="true"></i>Lisbon</span>
  <span class="chip"><span class="avatar bg-pink">AK</span>Ana Kim</span>
  <span class="chip bg-yellow">Featured</span>
  <span class="chip bg-green-soft"><i class="mi mi-check" aria-hidden="true"></i>In stock</span>
  <span class="chip bg-red-soft">Sold out</span>
</div>
<span class="chip">Design</span>
<span class="chip"><i class="mi mi-map-pin"></i>Lisbon</span>
<span class="chip"><span class="avatar bg-pink">AK</span>Ana Kim</span>
<span class="chip bg-green-soft">In stock</span>

Chips you can remove

Add a .chip-dismiss button with a label that says what it removes. The chip goes away and keyboard focus moves to the next one.

Shared with
AKAna Kim MRMarco Rossi PNPriya Nair LFLena Fischer
<div class="w-96 max-w-full">
  <div class="form-label mb-2" id="ch-people-label">Shared with</div>
  <div class="chip-group" id="ch-people" aria-labelledby="ch-people-label">
    <span class="chip"><span class="avatar bg-pink">AK</span>Ana Kim<button class="chip-dismiss" type="button" aria-label="Remove Ana Kim"></button></span>
    <span class="chip"><span class="avatar bg-cyan">MR</span>Marco Rossi<button class="chip-dismiss" type="button" aria-label="Remove Marco Rossi"></button></span>
    <span class="chip"><span class="avatar bg-violet">PN</span>Priya Nair<button class="chip-dismiss" type="button" aria-label="Remove Priya Nair"></button></span>
    <span class="chip"><span class="avatar bg-yellow">LF</span>Lena Fischer<button class="chip-dismiss" type="button" aria-label="Remove Lena Fischer"></button></span>
  </div>
</div>
<span class="chip">
  <span class="avatar bg-pink">AK</span>Ana Kim
  <button class="chip-dismiss" type="button" aria-label="Remove Ana Kim"></button>
</span>

<script>
  people.addEventListener('momo:chip-remove', (e) => {
    unshare(e.detail.chip);        // e.preventDefault() keeps the chip
  });
</script>

Chips you can press

Make the chip a <button> and wrap the row in data-momo-chips: one can be pressed at a time. data-momo-chips="multiple" lets several be pressed, and .chip-check adds a check mark to the pressed ones.

Order status (one)
Sizes in stock (several)

Chosen: s, m

<div class="stack" style="--stack-gap: 1.25rem">
  <div>
    <div class="form-label mb-2" id="ch-status-label">Order status (one)</div>
    <div class="chip-group" id="ch-status" data-momo-chips data-chips-required aria-labelledby="ch-status-label">
      <button class="chip" data-value="all" aria-pressed="true">All</button>
      <button class="chip" data-value="paid">Paid</button>
      <button class="chip" data-value="unpaid">Unpaid</button>
      <button class="chip" data-value="refunded">Refunded</button>
    </div>
  </div>
  <div>
    <div class="form-label mb-2" id="ch-size-label">Sizes in stock (several)</div>
    <div class="chip-group chip-check" id="ch-sizes" data-momo-chips="multiple" aria-labelledby="ch-size-label">
      <button class="chip" data-value="s" aria-pressed="true">Small</button>
      <button class="chip" data-value="m" aria-pressed="true">Medium</button>
      <button class="chip" data-value="l">Large</button>
      <button class="chip" data-value="xl" disabled>Extra large</button>
    </div>
    <p class="text-sm text-muted mt-3 mb-0">Chosen: <b id="ch-sizes-out">s, m</b></p>
  </div>
</div>
<script>
  document.getElementById('ch-sizes').addEventListener('momo:chips', function (e) {
    document.getElementById('ch-sizes-out').textContent = e.detail.values.join(', ') || 'none';
  });
</script>
<div class="chip-group chip-check" data-momo-chips="multiple" aria-label="Sizes">
  <button class="chip" data-value="s" aria-pressed="true">Small</button>
  <button class="chip" data-value="m">Medium</button>
</div>

<script>
  sizes.addEventListener('momo:chips', (e) => console.log(e.detail.values));   // ["s", "m"]
</script>

The row is one stop for the Tab key; the arrow keys move between its chips, and Space or Enter presses one. data-chips-required keeps one pressed at all times.

Sizes and shapes

.chip-sm and .chip-lg change the size. .chip-square uses Momo's normal corners. .chip-group-scroll keeps a long row on one line and lets it scroll sideways, for phones.

Small Normal Large Square SOSam Okafor
<div class="stack" style="--stack-gap: 1rem">
  <div class="chip-group">
    <span class="chip chip-sm">Small</span>
    <span class="chip">Normal</span>
    <span class="chip chip-lg">Large</span>
    <span class="chip chip-square">Square</span>
    <span class="chip chip-square"><span class="avatar bg-lime">SO</span>Sam Okafor</span>
  </div>
  <div class="chip-group chip-group-scroll w-80 max-w-full" id="ch-scroll" aria-label="Categories">
    <a class="chip" href="#sizes-and-shapes" aria-current="page">All</a>
    <a class="chip" href="#sizes-and-shapes">Bags</a>
    <a class="chip" href="#sizes-and-shapes">Clothes</a>
    <a class="chip" href="#sizes-and-shapes">Home</a>
    <a class="chip" href="#sizes-and-shapes">Stationery</a>
    <a class="chip" href="#sizes-and-shapes">Gift cards</a>
  </div>
</div>

Good to know

Reference

Class / attributeWhat it does
.chipThe chip (a span; a button or a link when it can be pressed)
.chip-dismissThe remove button inside a chip; event momo:chip-remove (cancelable), detail: { chip }
.chip-imgA picture at the start (an .avatar works the same way)
.chip-sm, .chip-lg, .chip-squareSizes, Momo's normal corners
.chip-group, .chip-group-scroll, .chip-checkA wrapping row, a one-line scrolling row, a check on pressed chips
data-momo-chips, ="multiple", data-chips-requiredPressable chips: one at a time, several, one always pressed
Event momo:chips, Momo.chips(group)detail: { values, chip }; values() and set(values)

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