Skip to content

Use gts components for examples #1689

Open

Description

@barryofguilder

Is there a way to use gts components for the examples? I've tried doing this, but I get runtime errors.

My example component (menu-default.gts) for the docs:

// BEGIN-SNIPPET docs-menu-default.gts
import Component from '@glimmer/component';
import UiMenu from '@onwardcare/ui-components/components/ui-menu';
import UiPortalTargets from '@onwardcare/ui-components/components/ui-portal-targets';
import DocsDemo from 'ember-cli-addon-docs/components/docs-demo';

interface Signature {
  Element: null;
}

export default class MenuDefault extends Component<Signature> {
  <template>
    <DocsDemo as |demo|>
      <demo.example @name='docs-menu-default.gts'>
        <UiPortalTargets />

        <UiMenu as |menu|>
          <menu.Trigger>Open Menu</menu.Trigger>

          <menu.Content as |content|>
            <content.Item>Item 1</content.Item>
            <content.Item>Item 2</content.Item>
          </menu.Content>
        </UiMenu>
      </demo.example>

      <demo.snippet @name='docs-menu-default.gts' />
    </DocsDemo>
  </template>
}
// END-SNIPPET

The runtime error I receive:
Image

Activity

  1. RobbieTheWagner commented on Feb 3, 2026

    @RobbieTheWagner
    Member

    My guess is addon docs does not support gjs/gts. I do not really know how the internals work.

  2. gkappen commented on Oct 30, 2026

    @gkappen

    We had some tokens to burn and this was one of our main issues...
    I have opened a Pull Request that adds support for gts and gjs snippets: #1713

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions