sterling-svelte  2.0.12
A modern, accessible, lightweight UI component library for Svelte.

Splitter

Provides relative resizing between two panes.

Code
<script lang="ts">
  import { Splitter } from '@geoffcox/sterling-svelte';
</script>

<Splitter resetOnDoubleClicks />

Members

Property NameTypeDefaultComment
horizontalboolean | null | undefinedundefinedWhen true, the panes are split top and bottom.
initialPrimarySizeCssSizeUnit | undefined50%The initial size of the primary pane.
minPrimarySizeCssSizeUnit | undefinedundefinedThe minimize width or height of the primary pane.
minSecondarySizeCssSizeUnit | undefinedundefinedThe minimize width or height of the secondary pane.
primarySnippet | undefinedundefinedThe content within the primary pane.
secondarySnippet | undefinedundefinedThe content within the secondary pane.
splitSnippet | undefined<div class="default-split-line></div>The visual split between the panes.
resetOnDoubleClickboolean | null | undefinedundefinedWhen true, double-clicking the split will reset the primary pane to the initial primary size.

Types

Type NameDefinitionComment
CssSizeUnitA CSS length (e.g. 120px, 4em, 20ch, 2cm) or CSS percentage (e.g. 25%).

Considerations

  • Includes HTMLDivElement props, events, and methods.

Anatomy

<div class="sterling-splitter">
    <div class="primary">
      {@render primary()}
    </div>
    <div class="split">
      {#if split}
        {@render split()}
      {:else}
        <div class="default-split-line"></div>
      {/if}
    </div>
    <div class="secondary">
      {@render secondary()}
    </div>
</div>