{"id":16791986,"url":"https://github.com/metonym/svelte-prose","last_synced_at":"2026-01-03T15:09:57.607Z","repository":{"id":57375321,"uuid":"257618765","full_name":"metonym/svelte-prose","owner":"metonym","description":"Typography utilities for Svelte","archived":false,"fork":false,"pushed_at":"2020-04-21T15:22:39.000Z","size":87,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T12:46:58.039Z","etag":null,"topics":["prose","table-of-contents","toc","typography"],"latest_commit_sha":null,"homepage":"https://metonym.github.io/svelte-prose/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metonym.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-21T14:17:11.000Z","updated_at":"2021-11-26T11:24:40.000Z","dependencies_parsed_at":"2022-09-05T13:21:14.656Z","dependency_job_id":null,"html_url":"https://github.com/metonym/svelte-prose","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fsvelte-prose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fsvelte-prose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fsvelte-prose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fsvelte-prose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metonym","download_url":"https://codeload.github.com/metonym/svelte-prose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960666,"owners_count":20375105,"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":["prose","table-of-contents","toc","typography"],"created_at":"2024-10-13T08:43:45.980Z","updated_at":"2026-01-03T15:09:57.568Z","avatar_url":"https://github.com/metonym.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svelte-prose\n\n[![NPM][npm]][npm-url]\n[![Build][build]][build-badge]\n\n\u003e Typography utilities for Svelte.\n\nInspired by the U.S. Web Design System [Prose component](https://designsystem.digital.gov/components/typography/#prose), `svelte-prose` is a collection of components for long-form typography.\n\n## Install\n\n```bash\nyarn add -D svelte-prose\n```\n\n## Usage\n\n```html\n\u003cscript\u003e\n  import Prose, { T } from \"svelte-prose\";\n\u003c/script\u003e\n\n\u003cProse\u003e\n  \u003cT.H1 text=\"Heading level 1\" /\u003e\n  \u003cT.H2 text=\"Heading level 2\" /\u003e\n  \u003cp\u003eSome text content.\u003c/p\u003e\n\u003c/Prose\u003e\n```\n\n### Headings\n\nA Heading component (`T.H1`, `T.H2`, `T.H3`, `T.H4`, `T.H5`, `T.H6`) automatically creates an id from the text prop.\n\n```html\n\u003cT.H1 text=\"Heading level 1\" /\u003e\n\u003c!-- \u003ch1 id=\"heading-level-1\"\u003eHeading level 1\u003c/h1\u003e --\u003e\n```\n\n### Table of Contents\n\nThe `Prose` component creates a two-tiered table of contents from headings.\n\nHide the default ToC to render your own:\n\n```html\n\u003cProse hideToc let:toc\u003e\n  \u003cnav\u003e\n    \u003cul\u003e\n      {#each toc as { id, text, children }}\n      \u003cli\u003e\n        \u003ca href=\"#{id}\"\u003e{text}\u003c/a\u003e\n        \u003cul\u003e\n          {#each children as child}\n          \u003cli\u003e\n            \u003ca href=\"#{child.id}\"\u003e{child.text}\u003c/a\u003e\n          \u003c/li\u003e\n          {/each}\n        \u003c/ul\u003e\n      \u003c/li\u003e\n      {/each}\n    \u003c/ul\u003e\n  \u003c/nav\u003e\n  \u003cT.H1 text=\"Heading level 1\" /\u003e\n  \u003cT.H2 text=\"Heading level 2\" /\u003e\n  \u003cp\u003eSome text content.\u003c/p\u003e\n\u003c/Prose\u003e\n```\n\n## API\n\n### `Prose`\n\n| Property name | Value                        |\n| :------------ | :--------------------------- |\n| hideToc       | `boolean` (default: `false`) |\n\n### `T.H{1-6}`\n\n| Property name | Value                           |\n| :------------ | :------------------------------ |\n| text          | `string` (default: `undefined`) |\n\n#### Forwarded events\n\n- on:click\n- on:mouseover\n- on:mouseenter\n- on:mouseout\n\n## [Changelog](CHANGELOG.md)\n\n## License\n\n[MIT](LICENSE)\n\n[npm]: https://img.shields.io/npm/v/svelte-prose.svg?color=blue\n[npm-url]: https://npmjs.com/package/svelte-prose\n[build]: https://travis-ci.com/metonym/svelte-prose.svg?branch=master\n[build-badge]: https://travis-ci.com/metonym/svelte-prose\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetonym%2Fsvelte-prose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetonym%2Fsvelte-prose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetonym%2Fsvelte-prose/lists"}