{"id":13725608,"url":"https://github.com/muhajirdev/monad-ui","last_synced_at":"2025-07-11T23:31:20.808Z","repository":{"id":48018118,"uuid":"183914463","full_name":"muhajirdev/monad-ui","owner":"muhajirdev","description":"Utility First CSS-in-JS","archived":false,"fork":false,"pushed_at":"2024-08-29T20:42:13.000Z","size":118,"stargazers_count":37,"open_issues_count":31,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T12:53:06.663Z","etag":null,"topics":["css","css-in-js","emotion","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muhajirdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-28T13:51:57.000Z","updated_at":"2024-03-01T15:33:58.000Z","dependencies_parsed_at":"2024-01-10T09:45:04.911Z","dependency_job_id":"32f478f4-7413-4606-9efb-683c9cc3dc43","html_url":"https://github.com/muhajirdev/monad-ui","commit_stats":{"total_commits":44,"total_committers":5,"mean_commits":8.8,"dds":0.2272727272727273,"last_synced_commit":"b3fa963d152b28d9fc8784b03cd7391b7dd193a8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/muhajirdev/monad-ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhajirdev%2Fmonad-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhajirdev%2Fmonad-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhajirdev%2Fmonad-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhajirdev%2Fmonad-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhajirdev","download_url":"https://codeload.github.com/muhajirdev/monad-ui/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhajirdev%2Fmonad-ui/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264913436,"owners_count":23682650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","css-in-js","emotion","react"],"created_at":"2024-08-03T01:02:28.921Z","updated_at":"2025-07-11T23:31:20.519Z","avatar_url":"https://github.com/muhajirdev.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD014 MD033 MD041 --\u003e\n\n![monad-ui](monad-ui.png)\n\n\u003cdiv align=center\u003e\n\nInspired by [Rebass](https://github.com/rebassjs/rebass), [TailwindCSS](https://github.com/tailwindcss/tailwindcss), [Smooth UI](https://github.com/smooth-code/smooth-ui), and [Material UI](https://github.com/mui-org/material-ui). \u003cbr\u003e\nImplemented in [Emotion](https://github.com/emotion-js/emotion).\n\n![npm](https://badgen.net/npm/v/monad-ui)\n![downloads](https://badgen.net/npm/dt/monad-ui)\n![license](https://badgen.net/npm/license/monad-ui)\n\n\u003c/div\u003e\n\n---\n\n- [Usage](#usage)\n  - [Basic example](#basic-example)\n  - [Responsive styles](#responsive-styles)\n- [Static vs Dynamic APIs](#static-vs-dynamic-apis)\n- [Available APIs](#available-apis)\n- [FAQs](#faqs)\n- [License](#license)\n\n---\n\n## Usage\n\n### Basic example\n\n```sh\n# using npm\nnpm install monad-ui\n\n# using yarn\nyarn add monad-ui\n```\n\n```jsx\nimport * as S from 'monad-ui';\n\n// blue background\nfunction Example() {\n  return (\n    \u003cdiv css={S.bg('blue')}\u003e\n      Lorem ipsum dolor sit, amet consectetur adipisicing elit.\n    \u003c/div\u003e\n  );\n}\n\n// blue background and red text color\nfunction Example() {\n  return (\n    \u003cdiv css={[S.bg('blue'), S.color('red')]}\u003e\n      Lorem ipsum dolor sit, amet consectetur adipisicing elit.\n    \u003c/div\u003e\n  );\n}\n```\n\n### Responsive styles\n\nMonad UI has four breakpoints ([view source](https://github.com/muhajirdev/monad-ui/blob/master/src/index.js#L8-L13)):\n\n```js\nconst breakpoints = {\n  sm: '576px',\n  md: '768px',\n  lg: '992px',\n  xl: '1200px'\n};\n```\n\nThere are many ways to implement responsive styles:\n\n1. **Array Responsive API**\n\n   ```js\n   import * as S from 'monad-ui';\n\n   function Example() {\n     return (\n       \u003cdiv css={S.bg(['red', 'green', 'blue'])}\u003e\n         Lorem ipsum dolor sit, amet consectetur adipisicing elit.\n       \u003c/div\u003e\n     );\n   }\n   ```\n\n   Example above will change the `div`'s `background` to `red`. When the screen size is above `576px`, it will be `green`. When the screen size is above `768px`, it will be `blue`. And so on.\n\n2. **Object Responsive API**\n\n   ```js\n   import * as S from 'monad-ui';\n\n   function Example() {\n     return (\n       \u003cdiv css={S.bg({ sm: 'red', lg: 'blue' })}\u003e\n         Lorem ipsum dolor sit, amet consectetur adipisicing elit.\n       \u003c/div\u003e\n     );\n   }\n   ```\n\n   Note that `md` is not specified. When it's not specified, it will take the previous value, which is `red` in this case.\n\n3. **Higher-order Function Responsive API**\n\n   ```js\n   import * as S from 'monad-ui';\n\n   function Example() {\n     return (\n       \u003cdiv css={S.up('sm')(S.hidden)}\u003e\n         Lorem ipsum dolor sit, amet consectetur adipisicing elit.\n       \u003c/div\u003e\n     );\n   }\n   ```\n\n   Example above will hide the `div` when the screen size is above `576px`.\n\n   ```js\n   import * as S from 'monad-ui';\n\n   function Example() {\n     return (\n       \u003cdiv css={S.up('sm')(S.bg('blue'))}\u003e\n         Lorem ipsum dolor sit, amet consectetur adipisicing elit.\n       \u003c/div\u003e\n     );\n   }\n   ```\n\n   Example above will change the `div`'s `background` into `blue` when the screen size is above `576px`.\n\n## Static vs Dynamic APIs\n\n- Dynamic type accept arguments (e.g. `S.bg('blue')`).\n- Static type does not accept arguments. (e.g. `S.down('md')(S.hidden)`).\n\n| Type    | Array Responsive API | Object Responsive API | High Order Responsive API |\n| ------- | -------------------- | --------------------- | ------------------------- |\n| Dynamic | ✅                   | ✅                    | ✅                        |\n| Static  | ❌                   | ❌                    | ✅                        |\n\n## Available APIs\n\nView all available APIs at [`./docs/available-apis.md`](./docs/available-apis.md).\n\n## FAQs\n\n- **Do I always have to `import * as S from 'monad-ui'`?**\n\n  If you only use a few styles, you can also import and use like this:\n\n  ```js\n  import { bg, hidden } from 'monad-ui';\n\n  function Example() {\n    return (\n      \u003cdiv css={bg('blue')}\u003e\n        Lorem ipsum dolor sit, amet consectetur adipisicing elit.\n      \u003c/div\u003e\n    );\n  }\n  ```\n\n- **Too many styles?**\n\n  Consider extracting your style outside like this:\n\n  ```js\n  import { css } from '@emotion/core';\n  import { bg, color } from 'monad-ui';\n\n  const style = css([bg('blue'), color('red')]);\n\n  function Example() {\n    return (\n      \u003cdiv class={style}\u003e\n        Lorem ipsum dolor sit, amet consectetur adipisicing elit.\n      \u003c/div\u003e\n    );\n  }\n  ```\n\n## License\n\n[ISC License, Copyright (c) 2020, Muhammad Muhajir](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhajirdev%2Fmonad-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhajirdev%2Fmonad-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhajirdev%2Fmonad-ui/lists"}