svelte-layout-resizable

resizable layout component for svelte

live demo

status

:warning: deprecated in favor of

usage

in your App.svelte add

<script>
  import L from 'svelte-layout-resizable';
</script>
<L row>
  <L>cell 1 in row</L>
  <L column>
    <L>cell 2.1 in column</L>
    <L>cell 2.2 in column</L>
    <L>cell 2.3 in column</L>
  </L>
  <L>cell 3 in row</L>
</L>

result:

screenshot of svelte-layout-resizable demo

<L row> is a broad container with css flex-direction: row

<L column> is a tall container with css flex-direction: column

if you dont like the <L> syntax
you can do import Layout from 'svelte-layout-resizable';
and use <Layout>cell</Layout>

style

the component defines only a minimal style
to implement containers and resize-handles

most users want to add style to their App.svelte, like

<style>
  /* layout */
  :global(body) {
    /* use full window size */
    padding: 0;
  }
  :global(.layout-cell>.middle>.center) {
    /* content cell: add scrollbars when needed */
    overflow: auto;
  }
  :global(.layout-cell>*>.frame) {
    /* frame color and border */
    /*background-color: #f4f4f4;*/
    border: solid 0.5px #a8a8a8;
  }
  :global(.layout-cell>*, .layout-cell>*>.frame) {
    /* frame size
       larger frames are better acccessible (touchscreen) */
    flex-basis: 2.5px !important;
  }
  /* use css classes on cells like
     <L class="overflow-hidden">....</L> */
  :global(.layout-cell>.middle>.center.overflow-hidden) {
    overflow: hidden !important;
  }
  /* use css classes on containers like
     <L row class="custom-row-container">....</L> */
  :global(.layout-row.custom-row-container) {
    color: orange;
  }
</style>

todo

license

license is creative commons zero 1.0