{"id":15029494,"url":"https://github.com/dashibase/lotion","last_synced_at":"2025-04-14T08:53:45.427Z","repository":{"id":49474688,"uuid":"517520796","full_name":"Dashibase/lotion","owner":"Dashibase","description":"An open-source Notion UI built with Vue 3 ","archived":false,"fork":false,"pushed_at":"2023-06-11T05:37:29.000Z","size":1708,"stargazers_count":2820,"open_issues_count":21,"forks_count":134,"subscribers_count":23,"default_branch":"main","last_synced_at":"2025-04-07T01:09:24.979Z","etag":null,"topics":["editorjs","hacktoberfest","markdown","notion","vue"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dashibase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-07-25T04:47:59.000Z","updated_at":"2025-04-05T12:02:23.000Z","dependencies_parsed_at":"2024-01-16T09:02:29.230Z","dependency_job_id":"7848c74c-4690-42bc-b4ed-993a6cfd05f3","html_url":"https://github.com/Dashibase/lotion","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dashibase%2Flotion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dashibase%2Flotion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dashibase%2Flotion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dashibase%2Flotion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dashibase","download_url":"https://codeload.github.com/Dashibase/lotion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852108,"owners_count":21171839,"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":["editorjs","hacktoberfest","markdown","notion","vue"],"created_at":"2024-09-24T20:10:49.823Z","updated_at":"2025-04-14T08:53:45.396Z","avatar_url":"https://github.com/Dashibase.png","language":"Vue","readme":"\u003ch1 align=\"center\"\u003e\u003cb\u003e🧴 Lotion\u003c/b\u003e\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  An open-source Notion UI built with Vue 3.\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://lotion.dashibase.com\" target=\"_blank\"\u003eTry demo\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://twitter.com/intent/follow?screen_name=dashibase\"\u003e\n    \u003cimg src=\"https://img.shields.io/twitter/follow/dashibase?style=social\u0026logo=twitter\" alt=\"follow on Twitter\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://discord.gg/HjJCwm5\"\u003e\n    \u003cimg src=\"https://img.shields.io/discord/995844576013201449?logo=discord\u0026logoColor=b0b7ff\u0026color=5865f2\" alt=\"chat on Discord\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/github/license/dashibase/lotion?color=green\" /\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@dashibase/lotion\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@dashibase/lotion\" /\u003e\n  \u003c/a\u003e\n  \u003cbr /\u003e\n\u003c/p\u003e\n\n\u003e We shared about Lotion and recreating the Notion UI during [CityJS Singapore's pre-conference meetup on 27th July](https://twitter.com/dashibase/status/1554070309224861696?s=20\u0026t=f9pkIgoxYUCgAL5tRTxK4Q)!\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/Dashibase/lotion/blob/main/assets/lotion.png\" style=\"border-radius: 10px;\" /\u003e\n\u003c/p\u003e\n\n## Features\n\n- [x] Block-based editor\n- [x] Drag to reorder blocks\n- [x] Basic Markdown-parsing including bold, italic, headings and divider\n- [x] Type '/' for command menu and shortcuts\n- [x] Register your own blocks\n- [x] Read-only mode\n\n## Getting Started\n\n**1. Install package**\n\n```bash\nnpm i @dashibase/lotion\n```\n\n**2. Basic Lotion editor**\n\nThe following Vue component will initialize a basic Lotion editor.\n\n```javascript\n\u003ctemplate\u003e\n  \u003cLotion :page=\"page\" /\u003e\n\u003c/template\u003e\n\u003cscript setup lang=\"ts\"\u003e\nimport { ref } from 'vue'\nimport { v4 as uuidv4 } from 'uuid'\nimport { Lotion, registerBlock } from '@dashibase/lotion'\n\nconst page = ref({\n  name: '🧴 Lotion',\n  blocks:[{\n    id: uuidv4(),\n    type: 'TEXT',\n    details: {\n      value: 'Hello, World!'\n    },\n  }],\n})\n\u003c/script\u003e\n```\n\n**3. Create custom components**\n\nSee `examples/CustomBlock.vue` for an example of a custom block.\n\nThe custom block component can accept the following props:\n- `block`: A `Block` object. See `src/utils/types.ts` for details.\n- `readonly`: A boolean, which sets whether the block/editor is in read-only mode.\n\nThe custom block component can also optionally expose the following methods (remember to call `defineExpose`):\n- `onSet`: This is triggered when a user converts any block into this blocktype. It is called before the blocktype is changed.\n- `onUnset`: This is triggered when a user converts this block into any blocktype. It is called before the blocktype is changed.\n\n```javascript\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    🧴\n  \u003c/div\u003e\n\u003c/template\u003e\n\u003cscript setup lang=\"ts\"\u003e\nimport { PropType } from 'vue'\nimport { types } from '../src'\n\nconst props = defineProps({\n  block: {\n    type: Object as PropType\u003ctypes.Block\u003e,\n    required: true,\n  },\n  readonly: {\n    type: Boolean,\n    default: false,\n  },\n})\n\nfunction onSet () {\n  alert('Moisturizing...')\n}\n\nfunction onUnset () {\n  alert('Moisturized!')\n}\n\ndefineExpose({\n  onSet,\n  onUnset,\n})\n\u003c/script\u003e\n\n```\n\n**4. Register custom components**\n\nSee `examples/Example.vue` for an example of registering a custom block.\n\nAfter creating the custom component, register it as follows:\n\n```javascript\nimport CustomBlock from './CustomBlock.vue'\nimport { addIcons } from \"oh-vue-icons\"\nimport { FaPumpSoap } from \"oh-vue-icons/icons\"\nimport { registerBlock } from '@dashibase/lotion'\n\n// Add the icon (from oh-vue-icons.js.org/)\naddIcons(FaPumpSoap)\n// Register the block\n// registerBlock('\u003cBLOCK_TYPE_ID\u003e', '\u003cBLOCK_TYPE_LABEL\u003e', \u003cBLOCK_COMPONENT\u003e, 'BLOCK_ICON')\nregisterBlock('LOTION', 'Moisturize', CustomBlock, 'fa-pump-soap')\n\u003c/script\u003e\n```\n\nAfter that, you should be able to see the custom block when the user opens the menu to switch to different blocks.\n\n## Contributing\n\n**1. Clone this repository, go to the root directory and install packages**\n\n```bash\ngit clone https://github.com/dashibase/lotion\ncd lotion\nnpm i\n```\n\n**2. Run dev**\n\n```bash\nnpm run dev\n```\n\nIf you head to http://localhost:5173 on your browser, you should see what looks like the screenshot above.\n\n**3. Contribute!**\n\nLotion is quite limited for now but we hope it serves as a good starting point for other folks looking to build their own editors.\n\nWe would love to make Lotion more extensible and welcome any suggestions or contributions!\n\nSee CONTRIBUTING.md for details.\n\n## Acknowledgements\n\nThis was made much easier with the following libraries and frameworks, thank you!\n\n- [vue-draggable-next](https://github.com/anish2690/vue-draggable-next)\n- [tiptap](https://tiptap.dev/) and [ProseMirror](https://prosemirror.net/)\n- [Vue 3](https://vuejs.org/)\n- [Vite](https://vitejs.dev/)\n- [TypeScript](https://www.typescriptlang.org/)\n- [Tailwind CSS](https://tailwindcss.com/)\n- [Headless UI](https://headlessui.dev/)\n- [Oh, Vue Icons!](https://oh-vue-icons.js.org/)\n- [Vitest](https://vitest.dev/)\n- [Playwright](https://playwright.dev/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdashibase%2Flotion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdashibase%2Flotion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdashibase%2Flotion/lists"}