|
| 1 | +--- |
| 2 | +title: Beacon |
| 3 | +minver: 0.23.0 |
| 4 | +also: |
| 5 | + elements/hx-beacon: <hx-beacon> |
| 6 | +--- |
| 7 | +{% extends 'component.njk' %} |
| 8 | + |
| 9 | +{% block page_header %} |
| 10 | + <p> |
| 11 | + A {{page.title}} is an animation that attracts a user's attention |
| 12 | + to a new feature or advanced functionality in a control panel. |
| 13 | + </p> |
| 14 | +{% endblock %} |
| 15 | + |
| 16 | +{% block content %} |
| 17 | + <section> |
| 18 | + <header> |
| 19 | + <h2 id="basic-beacon">Basic Beacon</h2> |
| 20 | + </header> |
| 21 | + <p> |
| 22 | + A beacon will emit a <code>dismiss</code> event and it will also be removed |
| 23 | + from the DOM, when a user clicks it. |
| 24 | + </p> |
| 25 | + <div class="example" id="vue-beaconDemo" v-cloak> |
| 26 | + <div> |
| 27 | + <hx-beacon |
| 28 | + @dismiss="onEvent" |
| 29 | + > |
| 30 | + </hx-beacon> |
| 31 | + </div> |
| 32 | + |
| 33 | + <footer> |
| 34 | + <pre><code v-text="snippet"></code></pre> |
| 35 | + </footer> |
| 36 | + </div> |
| 37 | + </section> |
| 38 | + |
| 39 | + |
| 40 | + <section> |
| 41 | + <header> |
| 42 | + <h2 id="beacon-with-inline-styles">Beacon with Inline Styles</h2> |
| 43 | + </header> |
| 44 | + <p> |
| 45 | + This is an example implementation of <code><hx-beacon></code>. |
| 46 | + We leave it to HelixUI implementors to decide what works best for their |
| 47 | + applications. |
| 48 | + </p> |
| 49 | + <p class="hxSubdued hxSubBody"> |
| 50 | + <hx-icon type="exclamation-triangle"></hx-icon> |
| 51 | + The parent element of the {{page.title}} must have |
| 52 | + <code>position:relative</code> set. Additionally, you may have to |
| 53 | + use <b>inline or additional styles</b> to adjust the |
| 54 | + <code><hx-beacon></code> position. Valid styles are <b>top</b>, |
| 55 | + <b>bottom</b>, <b>left</b>, <b>right</b>. (Please see demo snippet below) |
| 56 | + </p> |
| 57 | + <div class="example" id="vue-beacon-inline-styles" v-cloak> |
| 58 | + <header> |
| 59 | + <form class="beta-hxForm"> |
| 60 | + <fieldset> |
| 61 | + <hx-text-control> |
| 62 | + <input |
| 63 | + id="txtBeaconInlineStyles" |
| 64 | + type="text" |
| 65 | + v-model="beaconInlineStyles" |
| 66 | + /> |
| 67 | + <label for="txtBeaconInlineStyles"> |
| 68 | + Beacon Inline Styles |
| 69 | + </label> |
| 70 | + </hx-text-control> |
| 71 | + <p class="hxSubdued hxSubBody"> |
| 72 | + <hx-icon type="info-circle"></hx-icon> |
| 73 | + Use percentages and/or pixel values to adjust the position |
| 74 | + relative to the parent element. |
| 75 | + </p> |
| 76 | + </fieldset> |
| 77 | + </form> |
| 78 | + </header> |
| 79 | + |
| 80 | + <div style="position: relative; border: 1px dashed black;"> <!-- demo snippet --> |
| 81 | + <hx-beacon |
| 82 | + @dismiss="onEvent" |
| 83 | + :style="beaconInlineStyles" |
| 84 | + > |
| 85 | + </hx-beacon> |
| 86 | + <hx-disclosure class="hxBtn" aria-controls="basicMenuId"> |
| 87 | + <hx-icon type="cog"></hx-icon> |
| 88 | + <span>Actions</span> |
| 89 | + <hx-icon class="hxPrimary" type="angle-down"></hx-icon> |
| 90 | + </hx-disclosure> |
| 91 | + <hx-menu id="basicMenuId" :open="isOpen"> |
| 92 | + <hx-menuitem>Action 1</hx-menuitem> |
| 93 | + <hx-menuitem>Action 2</hx-menuitem> |
| 94 | + <hx-menuitem>Action 3</hx-menuitem> |
| 95 | + </hx-menu> |
| 96 | + </div> |
| 97 | + |
| 98 | + <footer> |
| 99 | + <pre><code v-text="snippetInlineStyles"></code></pre> |
| 100 | + </footer> |
| 101 | + </div> |
| 102 | + </section> |
| 103 | +{% endblock %} |
0 commit comments