@moooom/ui
v0.1.3
Published
Mo~oM Design System — CSS components, Line icons, and the <mom-icon> Web Component. Dark mode included.
Maintainers
Readme
@moooom/ui
The free tier of the Mo~oM design system. CSS components, 1,574 Line icons, and
the <mom-icon> element. Dark mode.
moooom.design · Docs · Icon browser
Install
npm i @moooom/uipnpm and yarn work the same way. No build step, no peer dependencies, no dependencies at all.
The stylesheet
import '@moooom/ui/css'Or without a bundler:
<link rel="stylesheet" href="/node_modules/@moooom/ui/dist/mom.css" />Components are plain classes, so any framework can render them:
<button class="mom-btn mom-btn--primary">
<span class="mom-btn__label">Save changes</span>
</button>Icons
<script src="/node_modules/@moooom/ui/dist/mom-icon.js"></script>
<script>MomIcon.setBasePath('/node_modules/@moooom/ui/dist/icons/')</script>
<mom-icon name="System/shield" size="24"></mom-icon>setBasePath is not optional. The element fetches SVGs at runtime and looks
under /src/icons/ until you tell it otherwise, so point it at wherever you
serve dist/icons/. name is the path inside the style folder, for example
Arrows/arrow-right. Colour comes from the CSS color property.
Every icon is also a real file you can import or copy directly:
import shield from '@moooom/ui/icons/Line/System/shield.svg'Interactive components
Components that need behaviour, like tabs and popovers, get it from one script with no framework attached:
<script src="/node_modules/@moooom/ui/dist/mom-behaviors.js"></script>import '@moooom/ui/behaviors'It enhances the markup already on the page. Keyboard handling and ARIA come with it.
React and Vue
import { ButtonRoot } from '@moooom/ui/wrappers/react'
import '@moooom/ui/css'
<ButtonRoot variant="primary">Save changes</ButtonRoot>Also @moooom/ui/wrappers/vue and @moooom/ui/wrappers/web, typed, same
component names in each.
Accent colour
Every component draws from one accent scale, so the whole system repoints from a single attribute:
<html data-accent="indigo">Nineteen scales are available. Set it on <html>, not on a section.
What Pro adds
| | Free | Pro | |---|---|---| | Icons | Line, 1,574 | Line, Duo, Sharp, Solid. 6,299 | | Components | 18 | 55 | | Modes | Dark | Light and dark |
Pro is $140 once, with lifetime updates: moooom.design/pro.
Upgrading changes no imports. You alias the paid package to this name and every import keeps working:
npm i @moooom/ui@npm:@moooom/ui-proLicence
Free for personal and commercial work, including client work, with no attribution required. You may not redistribute the files themselves as an icon set, a UI kit or a template, unless you have changed them substantially.
Full text at moooom.design/license, alongside
the Pro terms. The same text ships as LICENSE.md inside this package.
