UNPKG

@alegendstale/holly-components

Version:

Reusable UI components created using lit

37 lines (36 loc) 797 B
import { html } from 'lit'; import { createRef, ref } from 'lit/directives/ref.js'; const meta = { title: 'Absolute Container', tags: ['autodocs'], component: 'absolute-container', }; export default meta; const Template = { render: ({ disableContextEvent }) => { let absoluteRef = createRef(); return html ` <button @click=${() => { if (absoluteRef.value) { let absolute = absoluteRef.value; absolute.toggle(); } }} > Open Absolute Container </button> <absolute-container ?disableContextEvent=${disableContextEvent} open ${ref(absoluteRef)} > Hello </absolute-container> `; }, }; export const Example = { ...Template, args: {}, };