All Projects → xiaoyann → iakit

xiaoyann / iakit

Licence: MIT License
无依赖 mini 组件库,只封装了 alert, toast, loading, actionSheet 等使用频率较高的组件。适用于类似 H5 活动页的简单移动端项目,不必为了使用这些组件而引入一个大而全的 UI 库和框架。

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to iakit

Tfpopup
🚀🚀🚀TFPopup不生产弹框,它只是弹框的弹出工🚀🚀🚀默认支持多种动画方式一行调用,支持完全自定义动画.
Stars: ✭ 182 (+378.95%)
Mutual labels:  alert, toast, loading, actionsheet
jh-weapp-demo
微信小程序项目- 实现一些常用效果、封装通用组件和工具类
Stars: ✭ 60 (+57.89%)
Mutual labels:  alert, toast, loading
JDToaster
🍞 Toasty iOS alerts
Stars: ✭ 25 (-34.21%)
Mutual labels:  alert, uikit, toast
vue2-dialog
A mobile Vue plugin for VueDialog
Stars: ✭ 21 (-44.74%)
Mutual labels:  alert, toast, actionsheet
Uiwidget
一个集成TabLayout、UIAlertDialog、UIActionSheetDialog、UIProgressDialog、TitleBarView(自带沉浸式标题栏)、CollapsingTitleBarLayout、RadiusView(圆角及状态背景设置View解放shape文件)、KeyboardHelper(软键盘控制及遮挡控制类)、StatusViewHelper(状态栏沉浸帮助类)、NavigationViewHelper(导航栏沉浸式帮助类)、AlphaViewHelper(View透明度控制帮助类) 等项目常用UI库
Stars: ✭ 400 (+952.63%)
Mutual labels:  alert, loading, actionsheet
Easyshowview
一款非常简单的展示工具。提示框,加载框,空白页提示,alert弹出框。一行代码搞定所有操作。
Stars: ✭ 447 (+1076.32%)
Mutual labels:  alert, toast, actionsheet
Notiflix
Notiflix is a JavaScript library for client-side non-blocking notifications, popup boxes, loading indicators, and more that makes your web projects much better.
Stars: ✭ 172 (+352.63%)
Mutual labels:  alert, toast, loading
Alertift
Swifty, modern UIAlertController wrapper.
Stars: ✭ 242 (+536.84%)
Mutual labels:  alert, uikit, actionsheet
Squawk
Quick & interactive iOS alerts in Swift.
Stars: ✭ 254 (+568.42%)
Mutual labels:  alert, uikit, toast
Tail Kit
Tail-kit is a free and open source components and templates kit fully coded with Tailwind css 2.0.
Stars: ✭ 997 (+2523.68%)
Mutual labels:  components, uikit
Taiga Ui
Angular UI Kit and components library for awesome people
Stars: ✭ 1,353 (+3460.53%)
Mutual labels:  components, uikit
flutter easyloading
✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web
Stars: ✭ 1,021 (+2586.84%)
Mutual labels:  toast, loading
Shards React
⚛️A beautiful and modern React design system.
Stars: ✭ 639 (+1581.58%)
Mutual labels:  components, uikit
Shards Vue
🌟Shards Vue is a free, beautiful and modern Vue.js UI kit based on Shards.
Stars: ✭ 390 (+926.32%)
Mutual labels:  components, uikit
Retail Ui
React controls to implement standards at https://guides.kontur.ru/
Stars: ✭ 190 (+400%)
Mutual labels:  components, uikit
Chakra Ui
⚡️Simple, Modular & Accessible UI Components for your React Applications
Stars: ✭ 295 (+676.32%)
Mutual labels:  components, uikit
taiga-ui
Angular UI Kit and components library for awesome people
Stars: ✭ 2,251 (+5823.68%)
Mutual labels:  components, uikit
AlertKit
🚨 SwiftUI alerts (and action sheets) done right
Stars: ✭ 60 (+57.89%)
Mutual labels:  alert, actionsheet
ImageActionSheet
iOS Native style action sheet like in Whatsapp with the option of showing icons. It is a complete implementation and does not use any private api of UIKit.
Stars: ✭ 20 (-47.37%)
Mutual labels:  alert, actionsheet
NotificationToast
Google toast the Apple way !
Stars: ✭ 132 (+247.37%)
Mutual labels:  uikit, toast

iakit

无依赖 mini 组件库,只封装了 alert, toast, loading, actionSheet 等使用频率较高的组件。适用于类似 H5 活动页的简单移动端项目,不必为了使用这些组件而引入一个大而全的 UI 库和框架。

iakit.alert

iakit.loading

iakit.actionSheet

iakit.toast

Usage

使用 yarn/npm 安装,以模块化方式引入

$ yarn add iakit
import * as iakit from 'iakit'
import 'iakit/dist/style.css'

iakit.alert('提示', '测试测试测试测试')
iakit.loading.show()
iakit.actionsheet({/* 你的选项 */})
iakit.toast.showTop('测试测试测试')

也可以直接引入文件,比如使用 CDN

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/style.css">
<script src="https://unpkg.com/[email protected]/dist/index.js"></script>

<script>
  iakit.alert('提示', '测试测试测试测试')
  iakit.loading.show()
  iakit.actionsheet({/* 你的选项 */})
  iakit.toast.showTop('测试测试测试')
</script>

API

iakit.alert(title, content, buttons)

  • title: string,可选
  • content: string,必选
  • buttons: array | function,可选(button 结构:{ text: String, onClick: Function })
import * as iakit from 'iakit'

// demo 1.
iakit.alert('注册失败', '该邮箱已经被注册,如果有您有任何疑问请咨询客服。')

// demo 2.
iakit.alert(
  '注册失败',
  '该邮箱已经被注册,如果有您有任何疑问请咨询客服。',
  [
    { text: '取消', onClick: () => {} },
    { text: '确定', onClick: () => {} }
  ]
)
自定义选项
  • z-index:在页面有其他元素的使用了定位并且层级比较高时可以使用这个参数调整 alert 的层级
  • btnText: 默认按钮的文案是 “确定”,可以通过这个参数修改
iakit.alert.config({
  zIndex: 9999, // alert 的 z-index
  btnText: 'ok' // 默认按钮的文案
})

iakit.toast.showTop(content, time, callback)

  • content: string 必选
  • time: number 显示多少毫秒,可选,默认 1500
  • callback: function toast 消失后的回调,可选
import * as iakit from 'iakit'

// demo 1.
iakit.toast.showTop('注册成功')

// demo 2.
iakit.toast.showCenter('注册成功', 5000)

// demo 3.
iakit.toast.showBottom('注册成功', () => {
  // do something you want
})

iakit.loading.show()

import * as iakit from 'iakit'

iakit.loading.show()

setTimeout(() => {
  iakit.oading.hide()
}, 3000)

iakit.actionsheet(options)

options:

  • title: string,可选
  • options: array 可以操作的选项,必选(option 结构:{ text: String, disable: Boolean, onClick: Function })
  • destructiveIndex:number 危险选项的 index, 可选
import * as iakit from 'iakit'

iakit.actionsheet({
  options: [
    {
      text: '我再想想',
      disable: false,
      onClick: (i, text) => {}
    },
    {
      text: '去它的(disabled)',
      disable: true
    },
    {
      text: '就这样吧',
      onClick: (i, text) => {
      }
    }
  ],
  destructiveIndex: 2,
  title: '确认要分手吗?',
  onClick(i, text) {
    // 点击了没有指定 onClick 函数的选项时,执行这个函数
  },
  onCancel() {
    // 取消了
  }
})

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].