{"id":18438949,"url":"https://github.com/rotki/ui-library","last_synced_at":"2025-04-07T21:32:05.081Z","repository":{"id":161693902,"uuid":"617549569","full_name":"rotki/ui-library","owner":"rotki","description":"Rotki's vue component library","archived":false,"fork":false,"pushed_at":"2025-04-03T08:37:49.000Z","size":2459,"stargazers_count":5,"open_issues_count":7,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-04T09:42:31.382Z","etag":null,"topics":["components","library","ui","vue"],"latest_commit_sha":null,"homepage":"https://rotki.github.io/ui-library/","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rotki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-22T16:07:29.000Z","updated_at":"2025-04-03T08:37:52.000Z","dependencies_parsed_at":"2023-12-14T12:26:19.399Z","dependency_job_id":"ba409957-1cc8-4065-9be2-91d34865d2cf","html_url":"https://github.com/rotki/ui-library","commit_stats":null,"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rotki%2Fui-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rotki%2Fui-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rotki%2Fui-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rotki%2Fui-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rotki","download_url":"https://codeload.github.com/rotki/ui-library/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247732602,"owners_count":20986892,"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":["components","library","ui","vue"],"created_at":"2024-11-06T06:22:46.567Z","updated_at":"2025-04-07T21:32:05.067Z","avatar_url":"https://github.com/rotki.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @rotki/ui-library\n\nA Vue component library and design system for rotki\n\n[![npm (scoped)](https://img.shields.io/npm/v/@rotki/ui-library?style=flat-square)](https://www.npmjs.com/package/@rotki/ui-library)\n[![ci](https://github.com/rotki/ui-library/actions/workflows/ci.yml/badge.svg)](https://github.com/rotki/ui-library/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/rotki/ui-library/graph/badge.svg?token=9PIS7KMFC7)](https://codecov.io/gh/rotki/ui-library)\n\n## Getting started\n\n### Installing the library\n\nYou can start using the library after installing it from npm along with the roboto font:\n\n```bash\npnpm install -D --save-exact @rotki/ui-library @fontsource/roboto\n```\n\n### Importing the stylesheets\n\nDon't forget to import the `style.css` file from `@rotki/ui-library` along with the latin roboto font,\nin the project root (e.g main.ts)\n\n```typescript\nimport '@rotki/ui-library/dist/style.css';\nimport '@fontsource/roboto/latin.css';\n```\n\n### Using the plugin\n\nTo use the library you must install the library plugin:\n\n```typescript\nimport { createRui } from '@rotki/ui-library';\n\nconst RuiPlugin = createRui(options);\napp.use(RuiPlugin);\n```\n\n### Using the components\n\nThen you can you the library components e.g.:\n\n```vue\n\u003cscript setup lang=\"ts\"\u003e\nimport { RuiButton } from '@rotki/ui-library';\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cRuiButton outlined\u003e\n      This is button\n    \u003c/RuiButton\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n```\n\n### Managing the theme\n\nTo dynamically manage the theme you can use the theme manager\n\n```typescript\nimport { useRotkiTheme } from '@rotki/ui-library';\nconst { toggleThemeMode, setThemeConfig, switchThemeScheme, state, store } = useRotkiTheme();\n\n// to change the theme (pass colors as described by `ThemeConfig`) anytime:\nsetThemeConfig(newTheme);\n\n// to switch between auto|light|dark\ntoggleThemeMode();\n\n// to switch to a specific theme mode\nswitchThemeScheme(ThemeMode.dark);\n```\n\n### Using the icons\n\nYou need to specify which icons you want to enable, when installing the RuiPlugin.\n\n```typescript\nimport { createRui, Ri4kFill, Ri4kLine } from '@rotki/ui-library';\n\nconst RuiPlugin = createRui({\n  theme: {\n    icons: [Ri4kFill, Ri4kLine],\n  },\n});\napp.use(RuiPlugin);\n```\n\n```vue\n\u003cscript lang=\"ts\" setup\u003e\nimport { RuiIcon } from '@rotki/ui-library';\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cRuiIcon name=\"4k-fill\" /\u003e\n    \u003cRuiIcon name=\"4k-line\" /\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n```\n\n### Use @rotki/ui-library tailwindcss theme\n\nYou can extend @rotki/ui-library tailwind theme configuration by adding these to your tailwind config. It will provide you the classes for the colors, typography, and shadow.\n\n```javascript\n// tailwind.config.js\n\nmodule.exports = {\n  // ... your tailwind configs,\n  plugins: [require('@rotki/ui-library/theme')],\n};\n```\n\n## Development\n\n### Installation\n\nTo install the dependencies you need to run on the root of the repository\n\n```\npnpm install --frozen-lockfile\n```\n\n### Compiles and minifies for production\n\nThe following command when executed from the project root will build the `@rotki/ui-library` bundle.\nThis command will create the bundle for both Vue version \u003e=3.4.3.\n\n```\npnpm run build:prod\n```\n\nIf you want to build for specific version, you can run:\n\n```\npnpm run build\n```\n\n### Lint check\n\n```\npnpm run lint\n```\n\n### Lints and fixes files\n\n```\npnpm run lint:fix\n```\n\n### Type check\n\n```\npnpm run typecheck\n```\n\n### Storybook\n\nIn order to run the storybook, you can run:\n\n```\npnpm run storybook\n```\n\n### Testing: Unit\n\nIn order to test the components, you can run:\n\n```\npnpm run test\n```\n\n### Testing: end-to-end\n\nIn order to test the components in use in a vue 3 project, you can run:\n\n```\npnpm run test:e2e\n```\n\ncoverage results can be generated and previewed with:\n\n```\npnpm run coverage\npnpm run coverage:preview\n```\n\n### Locally testing the library\n\nAfter you build the bundle, in the `package.json` on your main project, you can add this to the dependencies:\n\n```json\n{\n  \"@rotki/ui-library\": \"file:...path_of_this_directory\"\n}\n```\n\nWhen the dependency installed on the main project, it will run the `prepare` script.\n\n### Generating the library icons\n\nWe use remix-icons. You need to run this script to scrap the svgs data from remix-icons. (This script runs automatically on `prepare`. Run this in case the icons aren't generated properly)\n\n```\npnpm run generate:icons\n```\n\n## License\n\n[AGPL-3.0](./LICENSE.md) License \u0026copy; 2023- [Rotki Solutions GmbH](https://github.com/rotki)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frotki%2Fui-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frotki%2Fui-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frotki%2Fui-library/lists"}