{"id":50612346,"url":"https://github.com/igniteui/igniteui-astro-components","last_synced_at":"2026-06-06T05:01:34.558Z","repository":{"id":355619587,"uuid":"1225559669","full_name":"IgniteUI/igniteui-astro-components","owner":"IgniteUI","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-02T13:01:08.000Z","size":953,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-02T13:05:48.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Astro","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/IgniteUI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-30T12:03:24.000Z","updated_at":"2026-06-02T12:58:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/IgniteUI/igniteui-astro-components","commit_stats":null,"previous_names":["igniteui/igniteui-astro-components"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/IgniteUI/igniteui-astro-components","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgniteUI%2Figniteui-astro-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgniteUI%2Figniteui-astro-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgniteUI%2Figniteui-astro-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgniteUI%2Figniteui-astro-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IgniteUI","download_url":"https://codeload.github.com/IgniteUI/igniteui-astro-components/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgniteUI%2Figniteui-astro-components/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33969883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-06-06T05:01:33.794Z","updated_at":"2026-06-06T05:01:34.544Z","avatar_url":"https://github.com/IgniteUI.png","language":"Astro","funding_links":[],"categories":[],"sub_categories":[],"readme":"# igniteui-astro-components\n\nReusable [Astro](https://astro.build) components, layouts, integrations, and\nutilities used to build Infragistics / Ignite UI documentation sites.\n\nThis package provides the navbar, sidebar, search, page frame, and MDX\ncomponents for Infragistics documentation sites, keeping the integration\nstory simple for consumer repos.\n\n\u003e **Status:** internal — published from this repo as a parallel copy of the\n\u003e components living in `docs-template`. Both trees are kept in sync until\n\u003e consumers migrate fully.\n\n---\n\n## Installation\n\n```sh\nnpm install igniteui-astro-components\n```\n\n`astro@^5 || ^6` is required as a peer dependency.\n\n---\n\n## Quick start\n\nAdd the integration to your `astro.config.ts`:\n\n```ts\nimport { defineConfig } from 'astro/config';\nimport { createDocsSite } from 'igniteui-astro-components/integration';\n\nexport default createDocsSite({\n  site: 'https://my-org.github.io/my-docs',\n  title: 'My Library',\n  description: 'Reference docs for My Library.',\n  platform: 'angular',          // 'angular' | 'react' | 'web-components' | 'blazor' | …\n  navLang: 'en',                // 'en' | 'jp' | 'kr'\n  source: {\n    tocPath:   './my-docs/toc.yml',\n    docsDir:   './my-docs/en/components',\n    imagesDir: './my-docs/en/images',\n  },\n});\n```\n\nUse the layout in a route:\n\n```astro\n---\nimport DocsLayout from 'igniteui-astro-components/layouts/DocsLayout.astro';\nimport DocsSidebar from 'igniteui-astro-components/components/sidebar/DocsSidebar.astro';\n\nconst { slug } = Astro.params;\n---\n\u003cDocsLayout title=\"Hello\" hasSidebar currentSlug={slug}\u003e\n  \u003cDocsSidebar slot=\"sidebar\" currentSlug={slug} /\u003e\n  \u003cslot /\u003e\n\u003c/DocsLayout\u003e\n```\n\nImport MDX components in a page or `mdx-components.ts`:\n\n```ts\nexport { default as ApiLink }      from 'igniteui-astro-components/components/mdx/ApiLink.astro';\nexport { default as ApiRef }       from 'igniteui-astro-components/components/mdx/ApiRef.astro';\nexport { default as PlatformBlock } from 'igniteui-astro-components/components/mdx/PlatformBlock.astro';\nexport { default as Sample }       from 'igniteui-astro-components/components/mdx/Sample.astro';\n```\n\nPull in the base styles once (e.g. from your root layout or `astro.config`):\n\n```ts\nimport 'igniteui-astro-components/styles/custom.scss';\nimport 'igniteui-astro-components/styles/ig-theme.scss';\n```\n\n---\n\n## Fonts\n\n`createDocsSite` (and the playground) configure **Instrument Sans** and **JetBrains Mono** via [Astro's built-in font API](https://docs.astro.build/en/guides/fonts/) (stable since Astro 6). This is better than a `\u003clink\u003e` to Google Fonts because fonts are downloaded and self-hosted at build time — no third-party CDN request, no user data sent to Google, faster load (one fewer network round-trip), and an auto-generated fallback stack that prevents layout shift (CLS).\n\n`DocsLayout` injects the `@font-face` declarations and `\u003clink rel=\"preload\"\u003e` tags into `\u003chead\u003e` via the `\u003cFont\u003e` component, and references the fonts through the CSS custom properties `var(--font-sans)` and `var(--font-mono)`.\n\n\u003e **Not using `createDocsSite`?** Add the font configuration manually to your own `astro.config.*`:\n\u003e\n\u003e ```ts\n\u003e import { defineConfig, fontProviders } from 'astro/config';\n\u003e\n\u003e export default defineConfig({\n\u003e   fonts: [\n\u003e     { provider: fontProviders.google(), name: 'Instrument Sans', cssVariable: '--font-sans', weights: ['400..700'], styles: ['normal', 'italic'] },\n\u003e     { provider: fontProviders.google(), name: 'JetBrains Mono',  cssVariable: '--font-mono', weights: ['100..800'], styles: ['normal', 'italic'] },\n\u003e   ],\n\u003e });\n\u003e ```\n\n---\n\n## Prop-driven usage (without `siteMetaIntegration`)\n\nBy default, `DocsLayout`, `DocsSidebar`, and `DocsSubHeader` read their data (site title, sidebar tree, product links) from the `virtual:docs-template/site-meta` virtual module that is provided by `siteMetaIntegration` / `createDocsSite`.\n\nIf you are not using the integration — for example when consuming the package via a GitHub dependency in a project that builds its own config — every piece of data can be passed directly as a prop instead.\n\n### DocsLayout\n\n| Prop | Overrides |\n|------|-----------|\n| `siteTitle` | `virtual:docs-template/site-meta` → `title` |\n\n```astro\n---\nimport DocsLayout from 'igniteui-astro-components/layouts/DocsLayout.astro';\n---\n\u003cDocsLayout title=\"Toast\" siteTitle=\"My Library\" hasSidebar currentSlug=\"components/toast\"\u003e\n  \u003cslot /\u003e\n\u003c/DocsLayout\u003e\n```\n\n### DocsSidebar\n\n| Prop | Overrides |\n|------|-----------|\n| `items` | `virtual:docs-template/site-meta` → `sidebar` |\n\n```astro\n---\nimport DocsSidebar from 'igniteui-astro-components/components/sidebar/DocsSidebar.astro';\nimport type { SidebarEntry } from 'igniteui-astro-components/lib/sidebar/types';\n\nconst sidebar: SidebarEntry[] = [\n  {\n    label: 'Getting Started',\n    collapsed: false,\n    items: [\n      { label: 'Introduction', slug: '' },\n      { label: 'Installation', slug: 'installation' },\n    ],\n  },\n  {\n    label: 'Components',\n    collapsed: false,\n    items: [\n      { label: 'Toast', slug: 'components/toast' },\n    ],\n  },\n];\n---\n\u003cDocsSidebar items={sidebar} currentSlug=\"components/toast\" /\u003e\n```\n\n### DocsSubHeader\n\n| Prop | Overrides |\n|------|-----------|\n| `siteTitle` | `virtual:docs-template/site-meta` → `title` |\n| `productLinks` | `virtual:docs-template/site-meta` → `productLinks` |\n| `sidebarItems` | `virtual:docs-template/site-meta` → `sidebar` (used for breadcrumb) |\n\n```astro\n---\nimport DocsSubHeader from 'igniteui-astro-components/components/DocsSubHeader.astro';\n\nconst productLinks = [\n  { label: 'Angular', href: '/angular/', platform: 'angular' },\n  { label: 'React',   href: '/react/',   platform: 'react' },\n];\n---\n\u003cDocsSubHeader\n  siteTitle=\"My Library\"\n  productLinks={productLinks}\n  currentSlug=\"components/toast\"\n/\u003e\n```\n\n### Combining prop-driven components without the integration\n\nA minimal setup that needs no virtual modules or Astro integration:\n\n```astro\n---\n// src/layouts/MyDocsLayout.astro\nimport DocsLayout from 'igniteui-astro-components/layouts/DocsLayout.astro';\nimport DocsSidebar from 'igniteui-astro-components/components/sidebar/DocsSidebar.astro';\nimport DocsToc from 'igniteui-astro-components/components/DocsToc.astro';\nimport type { SidebarEntry } from 'igniteui-astro-components/lib/sidebar/types';\nimport type { MarkdownHeading } from 'astro';\n\ninterface Props {\n  title: string;\n  currentSlug: string;\n  headings?: MarkdownHeading[];\n}\n\nconst { title, currentSlug, headings } = Astro.props;\n\nconst sidebar: SidebarEntry[] = [/* … your tree … */];\n---\n\u003cDocsLayout\n  title={title}\n  siteTitle=\"My Library\"\n  hasSidebar\n  currentSlug={currentSlug}\n\u003e\n  \u003cDocsSidebar slot=\"sidebar\" items={sidebar} currentSlug={currentSlug} /\u003e\n  {headings \u0026\u0026 \u003cDocsToc slot=\"toc\" headings={headings} offsetTarget=\".docs-subheader\" /\u003e}\n  \u003cslot /\u003e\n\u003c/DocsLayout\u003e\n```\n\n\u003e The virtual modules still need to be resolvable at build time (they are declared in `src/virtual-modules.d.ts`). When not using `siteMetaIntegration`, add stub exports to your `astro.config.ts` using the playground's `virtualDocsModules` pattern — see [playground/astro.config.mjs](playground/astro.config.mjs) for a reference implementation.\n\n---\n\n## What's included\n\n### Astro integration\n\n| Export | Purpose |\n| --- | --- |\n| `igniteui-astro-components/integration` | `createDocsSite()`, `siteMetaIntegration()`, `staticImagesIntegration()`, `buildSidebarFromToc()` re-export |\n\n### Layouts\n\n| Export | Purpose | Docs |\n| --- | --- | --- |\n| `igniteui-astro-components/layouts/DocsLayout.astro` | Top-level page shell — global nav + sub-header + optional sidebar + main frame + footer | [README](src/layouts/DocsLayout/README.md) |\n\n### Chrome components\n\n| Export | Purpose | Docs |\n| --- | --- | --- |\n| `…/components/GlobalNavBar.astro` | IG global navigation bar | [README](src/components/GlobalNavBar/README.md) |\n| `…/components/GlobalFooter.astro` | IG global footer | [README](src/components/GlobalFooter/README.md) |\n| `…/components/DocsSubHeader.astro` | Secondary fixed bar — site title + breadcrumb + product links + search | [README](src/components/DocsSubHeader/README.md) |\n| `…/components/Search.astro` | Pagefind-powered full-text search modal | [README](src/components/Search/README.md) |\n| `…/components/ThemingWidget.astro` | Theming widget | [README](src/components/ThemingWidget/README.md) |\n| `…/components/MobileSidebarToggle.astro` | Mobile-only sidebar disclosure button | [README](src/components/MobileSidebarToggle/README.md) |\n| `…/components/DocsToc.astro` | \"On this page\" table of contents with scroll-spy | [README](src/components/DocsToc/README.md) |\n\n### Sidebar suite\n\n| Export | Purpose | Docs |\n| --- | --- | --- |\n| `…/components/sidebar/DocsSidebar.astro` | Composition root — filter input + recursive tree | [README](src/components/sidebar/README.md) |\n| `…/components/sidebar/SidebarTree.astro` | Recursive `\u003cul\u003e` of items | [README](src/components/sidebar/README.md) |\n| `…/components/sidebar/SidebarItem.astro` | One link or `\u003cdetails\u003e` group | [README](src/components/sidebar/README.md) |\n| `…/components/sidebar/SidebarFilterInput.astro` | Filter input markup | [README](src/components/sidebar/README.md) |\n| `…/components/sidebar/sidebar-filter` | `\u003csidebar-filter\u003e` custom element + cross-navigation hooks | [README](src/components/sidebar/README.md) |\n| `…/lib/sidebar/types` | `SidebarEntry`, `SidebarGroup`, `SidebarLink`, `SidebarBadge` | — |\n| `…/lib/sidebar/helpers` | `isActive`, `isGroup`, `isInitiallyOpen`, `getBreadcrumb`, `joinPath`, … | — |\n| `…/sidebar` | `buildSidebarFromToc()` — TOC → sidebar tree converter (build-time) | — |\n\n### MDX components\n\n| Export | Purpose | Docs |\n| --- | --- | --- |\n| `…/components/mdx/ApiLink.astro` | Inline link to an API symbol with platform-aware URLs | [README](src/components/mdx/ApiLink/README.md) |\n| `…/components/mdx/ApiRef.astro` | Block API reference card | [README](src/components/mdx/ApiRef/README.md) |\n| `…/components/mdx/PlatformBlock.astro` | Show content only on selected platforms | [README](src/components/mdx/PlatformBlock/README.md) |\n| `…/components/mdx/Sample.astro` | Embedded code-view sample widget | [README](src/components/mdx/Sample/README.md) |\n\n### Build helpers\n\n| Export | Purpose |\n| --- | --- |\n| `…/platform` | Platform / nav-language types |\n| `…/content` | Content collection helpers |\n| `…/content-config` | Default content collection schema |\n| `…/llms` | `llms.txt` manifest generator |\n| `…/plugins/remark-env-vars` | Remark plugin — `{Environment.X}` token substitution |\n| `…/plugins/remark-md-links` | Remark plugin — `.md` → slug link rewriting + `DOCS_BASE` prepending |\n| `…/plugins/remark-html-transforms` | Remark plugin — divider→`\u003chr\u003e`, code lang normalization, img src fixes |\n\n### Styles\n\n| Export | Purpose |\n| --- | --- |\n| `…/styles/custom.scss` | Base tokens + sidebar/sample styles |\n| `…/styles/ig-theme.scss` | IG color palette mapped to design tokens |\n\n---\n\n## Subpath exports\n\nEvery component is reachable through an explicit subpath in\n[`package.json#exports`](./package.json). Bare-specifier imports\n(`igniteui-astro-components`) resolve to the JS/TS barrel\n[`src/index.ts`](./src/index.ts) which re-exports the runtime helpers only —\n`.astro` files must always be imported via their full subpath because Astro\ncomponents are not plain ES modules.\n\n---\n\n## Using from another repo without publishing a package\n\nYou do not need to release a version to npm to consume these components. Use one of the two approaches below.\n\n### Option A — npm `file:` link (recommended for active development)\n\nIn the consumer repo, add a `file:` reference in `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"igniteui-astro-components\": \"file:../path/to/astro-components\"\n  }\n}\n```\n\nRun `npm install` in the consumer repo. npm creates a symlink so every save in the components repo is instantly visible. All `package.json#exports` subpaths work exactly as they would with a published package.\n\n```sh\n# Consumer repo\nnpm install\n# or, to refresh after adding new exports:\nnpm install ../path/to/astro-components\n```\n\n\u003e **Windows note:** symlinks require Developer Mode or running your terminal as Administrator.\n\n### Option B — TypeScript / Vite path alias (no install step)\n\nAdd a path alias in the consumer's `tsconfig.json` and `astro.config.ts` that maps the package name to the local source:\n\n**`tsconfig.json`**\n```json\n{\n  \"compilerOptions\": {\n    \"paths\": {\n      \"igniteui-astro-components\":            [\"../astro-components/src/index.ts\"],\n      \"igniteui-astro-components/*\":          [\"../astro-components/src/*\"]\n    }\n  }\n}\n```\n\n**`astro.config.ts`**\n```ts\nimport path from 'node:path';\nimport { defineConfig } from 'astro/config';\n\nexport default defineConfig({\n  vite: {\n    resolve: {\n      alias: {\n        'igniteui-astro-components': path.resolve('../astro-components/src/index.ts'),\n      },\n    },\n  },\n});\n```\n\n\u003e The alias covers the JS/TS barrel. `.astro` component imports such as\n\u003e `'igniteui-astro-components/layouts/DocsLayout.astro'` resolve automatically\n\u003e through the `paths` wildcard in `tsconfig.json` — Astro's Vite pipeline\n\u003e handles them at build time.\n\n### Option C — direct relative imports (quick prototype)\n\nImport component files directly by relative path without any alias or install:\n\n```astro\n---\nimport DocsLayout from '../../astro-components/src/layouts/DocsLayout/DocsLayout.astro';\nimport DocsSidebar from '../../astro-components/src/components/sidebar/DocsSidebar.astro';\nimport ApiLink from '../../astro-components/src/components/mdx/ApiLink/ApiLink.astro';\n---\n```\n\nThis works immediately but ties your import paths to the internal folder structure. Switch to Option A or B before the project matures.\n\n---\n\n## Development\n\n```sh\nnpm install\n```\n\nThere is no build step — sources are published as-is and consumers compile\nthem through their own Astro / Vite pipeline. TypeScript is used only for\ntype-checking during development:\n\n```sh\nnpx tsc --noEmit\n```\n\n---\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figniteui%2Figniteui-astro-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figniteui%2Figniteui-astro-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figniteui%2Figniteui-astro-components/lists"}