Rich-Harris/svelte-split-pane
svelte-split-pane
A <SplitPane>
component.
Usage
<script>
import { SplitPane } from '@rich_harris/svelte-split-pane';
const dividerColor = 'black';
const dividerThickness = '20px';
</script>
<SplitPane
type="horizontal"
id="main"
min="100px"
max="-100px"
pos="50%"
priority="min"
--color={dividerColor}
--thickness={dividerThickness}
>
<section slot="a">this is on the left</section>
<section slot="b">this is on the right</section>
</SplitPane>
Of the properties that can be set on the component, only type
is required:
-
type
can behorizontal
, in which case the panes will be split left-right, orvertical
in which case it will be split top-bottom -
id
will be added to the element as adata-pane={id}
attribute, allowing you to (for example) override the--pos
CSS custom property on mobile -
min
,max
andpos
can be expressed as${number}%
,${number}px
,${number}em
or${number}rem
. Positive numbers are measured from the left/top, negative numbers are measured from the right/bottom -
priority
determines whether themin
ormax
constraint wins in cases where they conflict -
--color
determines the color of the divider between panes, and defaults totransparent
-
--thickness
determines how thick the 'hit area' is for the divider, and defaults to8px
最近版本更新:(数据更新于 2024-10-23 10:06:18)
Rich-Harris/svelte-split-pane同语言 Svelte最近更新仓库
2024-10-12 22:22:24 huntabyte/shadcn-svelte
2024-09-25 00:52:38 open-webui/open-webui
2024-07-29 10:24:42 taikoxyz/taiko-mono
2024-07-07 00:39:12 matt8707/ha-fusion
2024-06-27 03:30:40 saadeghi/daisyui
2024-06-16 21:58:49 orefalo/svelte-splitpanes