Modeless

An independent work window that leaves the background interface usable.

Live preview
Interact with the component to see results here.
View code
HTML
<sy-modeless
  closable
  draggable="true"
  width="280"
  height="220"
  top="80"
  left="12"
  resizable
  minimizable
  maximizable
  animation="none"
  id="sample"
><span slot="title">Task notes</span>
  <div slot="content">
    <p>Keep this window open while using other views.</p>
    <sy-input placeholder="Enter a note" aria-label="Task notes"></sy-input>
  </div>
</sy-modeless>
<div class="demo-actions"
  style="display:flex;flex-wrap:wrap;gap:8px;margin-top:16px"
>
  <sy-button id="action-0" size="small">Open work window</sy-button>
</div>
<output id="demo-result" aria-live="polite"></output>

<script type="module">
  const describeResult = value => JSON.stringify(value, (_key, item) => {
    if (item instanceof File) return {
      name: item.name,
      size: item.size,
      type: item.type
    };
    if (item instanceof Element) return `<${item.localName}>`;
    return item;
  }) ?? 'Done';
  const actionTarget0 = document.querySelector("#sample");
  document.querySelector('#action-0').addEventListener('click', async () => {
    const result = await actionTarget0.setOpen();
    document.querySelector('#demo-result').textContent = describeResult(result);
  });
</script>

Usage guide

#

Use for supporting windows that stay usable alongside the main view, such as notes or tools. Use Modal for mandatory confirmation.

Title and content
Use the title and content slots to make the window's purpose clear.
Position and size
Enable movement and resizing with draggable and resizable. After minimizing or maximizing, restore with setRestore().
Manage multiple windows
Create windows with sy-modeless-group's create() and manage them with updateTitle(), updateContent(), and close(). Give each window a unique id.

Feature examples

#

Choose a feature from 32 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.

Usage examples · Group Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Usage examples · Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Property · Closable

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Edge

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Height

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Draggable

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Left

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Maximizable

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Maximum

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Min Height

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Min Width

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Minimizable

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Minimum

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Open

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Resizable

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Top

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Width

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Methods · Group Methods / Close

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · Group Methods / CloseAll

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · Group Methods / Create

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · Group Methods / UpdateContent

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · Group Methods / UpdateOption

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · Group Methods / UpdateTitle

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · SetClose

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · SetMaximum

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · SetMinimum

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · SetOpen

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Methods · SetRestore

Use the example's buttons to call methods and inspect their results.

View code
HTML
Loading the example.

Events · Closed

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

Events · PositionChanged

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

Events · StatusChanged

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

Usage examples · Fixed window

Open a window with dragging and resizing disabled.

View code
HTML
<sy-modeless
  closable
  width="280"
  height="220"
  top="80"
  left="12"
  minimizable
  maximizable
  animation="none"
  id="sample"
><span slot="title">Task notes</span>
  <div slot="content">
    <p>Keep this window open while using other views.</p>
    <sy-input placeholder="Enter a note" aria-label="Task notes"></sy-input>
  </div>
</sy-modeless>
<div class="demo-actions"
  style="display:flex;flex-wrap:wrap;gap:8px;margin-top:16px"
>
  <sy-button id="action-0" size="small">Open work window</sy-button>
</div>
<output id="demo-result" aria-live="polite"></output>

<script type="module">
  const describeResult = value => JSON.stringify(value, (_key, item) => {
    if (item instanceof File) return {
      name: item.name,
      size: item.size,
      type: item.type
    };
    if (item instanceof Element) return `<${item.localName}>`;
    return item;
  }) ?? 'Done';
  const component1 = document.querySelector("#sample");
  Object.assign(component1, {
    "isDraggable": false,
    "resizable": false
  });
  const actionTarget0 = document.querySelector("#sample");
  document.querySelector('#action-0').addEventListener('click', async () => {
    const result = await actionTarget0.setOpen();
    document.querySelector('#demo-result').textContent = describeResult(result);
  });
</script>

API reference

#

Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.

<sy-modeless>

Properties

Attribute / PropertyTypeDefaultDescription
booleanfalseWhether the submenu is expanded.
| 'none' | 'fade' | 'fade-scale' | 'zoom' | 'pop' | 'slide-top' | 'slide-bottom' | 'slide-left' | 'slide-right' | 'slide-fade-top' | 'slide-fade-bottom' | 'slide-fade-left' | 'slide-fade-right' | 'reveal-top' | 'reveal-bottom' | 'reveal-left' | 'reveal-right' | 'flip-x' | 'flip-y' | 'bounce' | 'spin''none'Enter/exit animation type. `none` (default) toggles instantly.
'x-fast' | 'fast' | 'medium' | 'slow' | 'x-slow''fast'Animation playback speed token. Maps to `--transition-*` global tokens.
booleanfalseAllow the window to be moved by dragging its title.
booleanfalseAllow resizing from the window edges.
booleanfalseShow the close button.
booleanfalseShow the minimize button.
booleanfalseShow the maximize button.
booleanfalseApply window border styling.
booleanfalseMaximized state.
booleanfalseMinimized state.
number | undefinedundefinedPosition from the top of the screen, in pixels.
number | undefinedundefinedPosition from the left of the screen, in pixels.
number200Window width in pixels.
number150Window height in pixels.
unknownDEFAULT_MIN_WIDTHMinimum window width in pixels.
unknownDEFAULT_MIN_HEIGHTMinimum window height in pixels.

Events

EventDetailDescription
CustomEvent<{ id: string }>Read the result from the event's detail.
CustomEvent<{ id: string; status: string }>Read the result from the event's detail.
CustomEvent<ModelessPositionChangedDetail>Read the result from the event's detail.

Methods

MethodReturnsDescription
Promise<void>Expand the submenu.
Promise<void>Close the item.
Promise<void>Maximize the window.
Promise<void>Restore the window to its original size.
Promise<void>Minimize the window.

Slots

SlotDescription
Content displayed in the title area.
Content displayed in the header area.
Content displayed in the content area.

<sy-modeless-group>

Methods

MethodReturnsDescription
Promise<void>Create a new Modeless window with a unique id.
Promise<void>Change the content of the window with the specified id.
Promise<void>Change the title of the window with the specified id.
Promise<void>Change settings such as position and size for the window with the specified id.
Promise<void>Close the open panel.
Promise<void>Collapse all panels.

Slots

SlotDescription
Component body or child items.