npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-split-view

v1.0.1

Published

A resizable flex-box split layout component for Angular

Downloads

469

Readme

Split View

A split view component for Angular applications that allows users to resize the panes within it.

Table of Contents

  1. Installation
  2. Usage
  3. Examples
  4. Documentation
  5. Thanks

Installation

Install using npm in the usual way

$ npm install ngx-split-view --save

Usage

  1. Once you have installed ngx-split-view, you can import it in your AppModule:
// a. Import SplitViewModule
import { SplitViewModule } from 'ngx-split-view';

@NgModule({
  // ....

  imports: [
    // b. Add SplitViewModule to your NgModule imports
    SplitViewModule
  ]
})
export class AppModule { }
  1. Start using the split-view component in your templates
<split-view>
  <div splitPane [splitRatio]="2">Left pane (2/3rds size)</div>
  <div splitPane [splitRatio]="1">Right pane (1/3rd size)</div>
</split-view>

Important Note: Always place the square brackets around the splitRatio attribute.

Examples

Minimum size pane

<split-view>
  <div splitPane [splitRatio]="2">Left pane (2/3rds size)</div>
  <div splitPane [splitRatio]="1" minSize="300">Right pane (1/3rd size)</div>
</split-view>

Horizontal split

<split-view direction="horizontal">
  <div splitPane [splitRatio]="2">Left pane (2/3rds size)</div>
  <div splitPane [splitRatio]="1">Right pane (1/3rd size)</div>
</split-view>

Custom gutter template

<split-view>
  <div splitPane [splitRatio]="2">Left pane (2/3rds size)</div>
  <div splitPane [splitRatio]="1">Right pane (1/3rd size)</div>
  <div *gutterTemplate style="background: green"></div>
</split-view>

Documentation

SplitViewComponent

The container for split view panes. It will render all content with SplitPaneDirective, ignoring all other content.

Selector: split-view

Properties

| Name | Description | Default | |-----------------------------------------|---------------------------------------------|--------------| | @Input() expandToMin: boolean | Grow initial sizes to minSize on each pane | false | | @Input() gutterSize: number | Gutter size in pixels | 10 | | @Input() gutterAlign: GutterAlignment | Gutter alignment between elements | center | | @Input() snapOffset: number | Snap to minimum size offset in pixels | 30 | | @Input() dragInterval: number | Number of pixels to drag | 1 | | @Input() direction: SplitDirection | Direction to split: horizontal or vertical | horizontal |

Events

| Name | Description | |------------------------------------------------|-----------------------| | @Output() dragging: EventEmitter<DragEvent> | Called while dragging | | @Output() dragStart: EventEmitter<DragEvent> | Called on drag start | | @Output() dragEnd: EventEmitter<DragEvent> | Called on drag end |

Notes

These options map one-to-one with those exposed by split.js. Please see the documentation for more information

SplitPaneDirective

Pane selection directive. Allows specifying the ratio and minimum size of panes within the split-view. Content without this directive will not be displayed.

Selector: [splitPane]

Properties

| Name | Description | Default | |-------------------------------|---------------------------------|--------------| | @Input() splitRatio: number | The size of the pane as a ratio | 1 | | @Input() minSize: number | Minimum sizes pane in pixels | 100 |

SplitViewGutterDirective

The gutter definition for the split-view. Captures the template gutters.

Selector: [gutterTemplate]

Thanks

This component uses the excellent split.js library by Nathan Cahill to do the heavy lifting.