{"schemaVersion":1,"id":"shiki","name":"Shiki","locale":"en","canonicalUrl":"https://base.akulich.dev/en/library/shiki/","officialUrl":"https://github.com/shikijs/shiki","isCatalog":false,"description":"Syntax highlighting using TextMate grammars: generates HTML to display code in documentation, blogs, and developer interfaces.","tasks":["Display code with syntax highlighting","Generate highlighted HTML and add it to the documentation page"],"categoryIds":["frontend"],"subcategoryIds":["frontend.utilities"],"tags":["Shiki","web","Development"],"aliases":["shikijs/shiki","shiki-syntax-highlighter","shiki"],"platforms":[],"stack":[],"compatibility":null,"pricing":"free","freeUsage":"Code and local use under MIT.","paidUsage":"Computing resources, self-hosting, and external services are paid for separately if used.","license":"MIT for the code; dependencies have separate licenses.","selectionGuide":{"purpose":"Display code with syntax highlighting","chooseWhen":["Display code with syntax highlighting","Generate highlighted HTML and add it to the documentation page"],"considerInstead":[],"requirements":["For codeToHtml, specify lang and theme; with your own highlighter, preload the required languages and themes."],"limitations":["Costs and limits of free use: Computing resources, self-hosting, and external services are paid for separately if used.","Terms of use: MIT for the code; dependencies have separate licenses.","createHighlighter and resource loading are asynchronous; the created instance is recommended to be cached rather than recreated in a hot loop."],"faq":[{"question":"What can you use for free in Shiki?","answer":"Code and local use under MIT."},{"question":"What additional costs might arise with Shiki?","answer":"Computing resources, self-hosting, and external services are paid for separately if used."},{"question":"What terms of use matter for Shiki?","answer":"MIT for the code; dependencies have separate licenses."},{"question":"How do you get started with Shiki?","answer":"Choose the code block's language, grammar, and theme. Generate highlighted HTML and add it to the documentation page. Add real data and error handling; check the production build."},{"question":"Do you need CSS for each token's color?","answer":"codeToHtml returns HTML with inline styles on tokens. Shorthands load the required language/theme themselves and cache them in memory."},{"question":"How do you highlight synchronously after initialization?","answer":"Create a highlighter using await createHighlighter with the langs/themes list. Then codeToHtml on that instance runs synchronously for resources already loaded; load additional resources through loadLanguage/loadTheme."}],"related":[],"sources":["https://github.com/shikijs/shiki","https://raw.githubusercontent.com/shikijs/shiki/HEAD/README.md","https://raw.githubusercontent.com/shikijs/shiki/HEAD/LICENSE","https://www.open-source-tools.com/","https://shiki.style/guide/install"]},"selectionCheckedAt":null,"applicationGuide":{"goal":"Display code with syntax highlighting.","inputs":["Web application source code and the intended workflow.","The project's framework and runtime version."],"steps":["Choose the code block's language, grammar, and theme.","Generate highlighted HTML and add it to the documentation page.","Add real data and error handling; check the production build."],"checks":["The workflow works after a page refresh and with invalid data.","The bundle, server rendering, and supported browsers suit the project."]},"sources":["https://github.com/shikijs/shiki","https://raw.githubusercontent.com/shikijs/shiki/HEAD/README.md","https://raw.githubusercontent.com/shikijs/shiki/HEAD/LICENSE","https://www.open-source-tools.com/","https://shiki.style/guide/install"],"checkedAt":"2026-10-06","reviewScope":"The purpose, current repository license, and separate terms for code, services, and models have been reviewed. The product was not run, and no security audit was performed.","relatedIds":[],"dataVersion":"cbbe7123b47a5ae80983","type":"Web framework / library","kind":"library","pricingNote":"Code and local use under MIT. Computing resources, self-hosting, and external services are paid for separately if used.","notes":null,"labeledSources":[{"url":"https://github.com/shikijs/shiki","label":"Official source"},{"url":"https://raw.githubusercontent.com/shikijs/shiki/HEAD/README.md","label":"Official source"},{"url":"https://raw.githubusercontent.com/shikijs/shiki/HEAD/LICENSE","label":"License"},{"url":"https://www.open-source-tools.com/","label":"Catalog / discovery source"},{"url":"https://shiki.style/guide/install","label":"Official source"}],"licenseGuides":[{"id":"mit","title":"MIT — permissive license","scope":null,"summary":"You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.","url":"https://opensource.org/license/mit"}],"entryIds":[],"composition":null}