Skip to content

UI Helpers

ZhinNX menyediakan UI helper kecil supaya project deadline tidak perlu membuat feedback dasar dari nol.

toast()

js
toast('Saved')
js
modal({
  title: 'Details',
  content: 'Modal ini dirender oleh ZhinNX.'
})

confirm()

js
const accepted = await confirm({
  title: 'Reset data?',
  content: 'Aksi ini tidak bisa dibatalkan.'
})

if (accepted) {
  console.log('reset')
}

sheet()

js
sheet({
  title: 'Actions',
  content: '<button @click="closeSheet">Close</button>'
})

loading()

js
const stop = loading('Loading data')
await api.get('/api/items')
stop()

cx()

cx() menggabungkan class secara kondisional.

js
const className = cx('button', isActive && 'active')

Released under the MIT License.