{"id":28828797,"url":"https://github.com/mojotech/mojotech-ui","last_synced_at":"2025-10-12T16:55:55.907Z","repository":{"id":37502738,"uuid":"160368626","full_name":"mojotech/mojotech-ui","owner":"mojotech","description":"A set of styled React components for MojoTech.com user interfaces.","archived":false,"fork":false,"pushed_at":"2023-08-01T15:20:22.000Z","size":4092,"stargazers_count":6,"open_issues_count":20,"forks_count":0,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-05-24T11:32:41.644Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ui.mojotech.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mojotech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-04T14:17:56.000Z","updated_at":"2024-11-04T17:29:11.000Z","dependencies_parsed_at":"2023-02-18T02:45:40.905Z","dependency_job_id":null,"html_url":"https://github.com/mojotech/mojotech-ui","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/mojotech/mojotech-ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojotech%2Fmojotech-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojotech%2Fmojotech-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojotech%2Fmojotech-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojotech%2Fmojotech-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mojotech","download_url":"https://codeload.github.com/mojotech/mojotech-ui/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojotech%2Fmojotech-ui/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260690920,"owners_count":23047102,"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":[],"created_at":"2025-06-19T05:10:22.045Z","updated_at":"2025-10-12T16:55:55.902Z","avatar_url":"https://github.com/mojotech.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MojoTech UI\nA set of styled React components for MojoTech.com user interfaces.\n\n## Usage\nMojo-UI is available as an npm module. Install the ui lib and peer dependencies\n\n```sh\n# with yarn\nyarn add @mojotech/mojo-ui @emotion/core @emotion/styled emotion-theming onno-react\n\n# with npm\nnpm install @mojotech/mojo-ui @emotion/core @emotion/styled emotion-theming onno-react\n```\nWhen using make sure to wrap all the components in the `\u003cThemeDecorator /\u003e` component. This component provides the theme styles for the components, as well as adds MojoTech fonts and CSS reset.\n\nExample:\n```tsx\nimport * as React from 'react'\nimport { ThemeDecorator, Section, Text } from '@mojotech/mojo-ui'\n\nconst Page: React.FunctionComponent = () =\u003e (\n  \u003cThemeDecorator\u003e\n    \u003cSection\u003e\n      \u003cText as=\"h1\" fontSize={5}\u003eBuild Better.\u003c/Text\u003e\n    \u003c/Section\u003e\n  \u003c/ThemeDecorator\u003e\n)\n\n```\n\n## Development\nUpon cloning the repo and installing the dependencies run `npm start` to start the storybook dev server. Run `npm run build-storybook` to build a static version of the storybook to the `storybook-static` folder. Run `npm build` to compile the library into the `dist` folder.\n\n### Components\nThe components in this library are built using [emotion](https://emotion.sh/docs/styled), and [onno](https://github.com/wagerfield/onno). Emotion itself handles the styling of the components and onno provides the ability to use style props.\n\n#### Theme\nThe core of the entire ui library is the [theme file](https://github.com/mojotech/mojotech-ui/blob/master/src/lib/theme.ts). The theme allows us to create a cohesive system of style values that are used across all components. The theme keys correspond to the [render functions](https://github.com/wagerfield/onno/blob/master/docs/render-functions.md) in onno. The array index of the property set in the theme is what onno looks for when applying the style.\n\n#### Style Props\nTo style the components we use style props. For example:\n```tsx\n\u003cBox marginBottom={2} /\u003e\n```\nThis would render out the Box component with a `marginBottom` that corresponds with the array index of `2` in the `spaces` [key](https://github.com/mojotech/mojotech-ui/blob/dcbd11b74014ed5f9392dd3bcbe6b55ac9ab0ecb/src/lib/theme.ts#L16) in the theme. The style props that are allowed to be used for each component are dictated by the render functions that each component uses. You can use your own non-theme values within the style props, but this should be only use sparingly as a means to preserve uniformity. For an extensive list of which css properties correspond to which render function visit the [onno docs](https://github.com/wagerfield/onno/blob/master/docs/render-functions.md).\n\n#### Responsive Values\nThe breakpoints for the components are set via the theme. For example:\n```ts\nbreakpoints: [0, 600, 1200]\n```\nThis would set three `min-width` breakpoints. One at `0px`, `600px`, and `1200px`. To create responsive styles within a component you would use this syntax\n```tsx\n\u003cBox marginBottom={[0, 1, 2]} /\u003e\n```\nThis would set the `marginBottom` within each breakpoint at the corresponding index.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmojotech%2Fmojotech-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmojotech%2Fmojotech-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmojotech%2Fmojotech-ui/lists"}