Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Hds::DisclosurePrimitive>
<:toggle as |t|>
<button type="button" {{on "click" t.onClickToggle}}>Click me</button>
</:toggle>
<:content>
your content here
</:content>
</Hds::DisclosurePrimitive>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { TemplateOnlyComponent } from '@ember/component/template-only';
import { on } from '@ember/modifier';

import { HdsDisclosurePrimitive } from '@hashicorp/design-system-components/components';

const LocalComponent: TemplateOnlyComponent = <template>
<HdsDisclosurePrimitive>
<:toggle as |t|>
<button type="button" {{on "click" t.onClickToggle}}>Click me</button>
</:toggle>
<:content>
your content here
</:content>
</HdsDisclosurePrimitive>
</template>;

export default LocalComponent;
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,7 @@ The `DisclosurePrimitive` component renders an interactive element that triggers

When the content is disclosed, the container can be closed by toggling the button (`click` or `enter/return`).

```handlebars
<Hds::DisclosurePrimitive>
<:toggle as |t|>
<button type="button" {{on "click" t.onClickToggle}}>Click me</button>
</:toggle>
<:content>
your content here
</:content>
</Hds::DisclosurePrimitive>
```
[[code-snippets/disclosure-primitive-basic]]

### Content positioning

Expand Down