0.1.19 • Published 5 years ago

kaku-ui v0.1.19

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Kaku 殻

Yet Another UI Kit

Usage

install deps

npm i kaku-ui
npm i -D babel-plugin-import

config babel.config.js

plugins: [["import", {
  libraryName: 'kaku-ui',
  libraryDirectory: 'dist',
  style: (name) => {
      if (name && name.indexOf('util') >= 0) {
        return false
      }
      return `${name}/style.css`
    },
}]]

import base style

import 'kaku-ui/dist/style.css'

import component

import { Toast } from 'kaku-ui'

Components

Toast

same as JK.toast

Toast(message: string, [duration: number, [status: string]])
Parameterstypedefault
messagetoast contentstring
durationdisplay durationnumber2000
statusicon typesuccess|errorsuccess

Alert

same as JK.alert

Alert({
  imageUrl: string,
  title?: string,
  message?: string,
  positiveButtonText: string,
  negativeButtonText?: string
}): Promise<{ result: AlertResult }>

type AlertResult = 'positive' | 'negative' | 'close'

Image

  • Lazy load (Support Intersection Observer, auto fallback to Event-based listeners)
  • Support backgound img
Propstypedefault
modeuse io or event, auto when not setundefined | 'event'undefined
altimg altstring
urlimg srcstring
isBackgroundbooleanfalse
lazyenable lazy loadbooleanfalse
lazyOptionsconfig lay loadobject
lazyOptions.rootIntersection Observer rootHTMLElementundefined (viewport)
lazyOptions.rootMarginIntersection Observer rootMarginCSS margin string like'200px 0px 200px 0px'
lazyOptions.xThresholdxThreshold (px)number0
lazyOptions.yThresholdyThreshold (px)number200
lazyOptions.maxItemsmax listen items only when use event modenumber200
lazyOptions.checkIntervalcheck intervel only when use event modenumber500

Notice: rootMargin = rootMargin || ${yThreshold}px ${xThreshold}px ${yThreshold}px ${xThreshold}px

Reference

0.1.19

5 years ago

0.1.18

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago