Giter VIP home page Giter VIP logo

ddanninger / flex-splitter-directive Goto Github PK

View Code? Open in Web Editor NEW

This project forked from luncheon/flex-splitter-directive

0.0 1.0 0.0 228 KB

Dead simple panes splitter control based on flexbox. JS + CSS < 1kB (gzipped) with no dependencies.

Home Page: https://luncheon.github.io/flex-splitter-directive/

License: Do What The F*ck You Want To Public License

HTML 45.63% JavaScript 21.54% TypeScript 20.33% CSS 12.50%

flex-splitter-directive's Introduction

flex-splitter-directive

Dead simple panes splitter control based on flexbox.

Demo

  • Declarative.
    Just add an attribute to the DOM element. Don't need to write any JavaScript.
  • Lightweight.
    JS + CSS < 1kB (gzipped) with no dependencies.
  • Maintainable. Ah, maybe.
    The source code contains only 65 lines of TypeScript code and 43 lines of Stylus code.
    If you don't like it partially, you can clone it and make changes.

Installation

npm (with a module bundler)

$ npm i flex-splitter-directive
import "flex-splitter-directive"
import "flex-splitter-directive/styles.min.css"

CDN (jsDelivr)

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/styles.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

Download Directly

Usage

  1. Load CSS and JS.
  2. Set data-flex-splitter-horizontal (or data-flex-splitter-vertical for vertical) attribute to the parent element of the panes.
  3. Insert <div role="separator"></div> between each pane.
  4. Set the following styles for each pane as required:
    • width / height for the initial size.
    • min-width / min-height for the minimum size.
    • max-width / max-height for the maximum size.
    • flex: auto for filling space.

License

WTFPL

Other vanilla-js panes splitters

flex-splitter-directive's People

Contributors

luncheon avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.