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

@imo-tikuwa/vue3-bootstrap5-composables

v0.2.2

Published

Vue3&Bootstrap5 composable plugins.

Downloads

4

Readme

@imo-tikuwa/vue3-bootstrap5-composables

provide composable plugins for environments using vue3 and boostrap5.

Installation

npm install -D @imo-tikuwa/vue3-bootstrap5-composables

Usage

ConfirmModalPlugin

  1. import plugin.
import { createApp } from 'vue'
import App from './App.vue'

import { ConfirmModalPlugin } from '@imo-tikuwa/vue3-bootstrap5-composables'

createApp(App).use(ConfirmModalPlugin).mount('#app')
  1. append ConfirmModalInjection component in root Vue file(App.vue).
  <div class="container">
    <router-view />

    <ConfirmModalInjection />
  </div>
  1. wrote codes on the page where you want to display the confirmation modal. import useConfirmModal composable and call show method.
<script setup lang="ts">
import { useConfirmModal } from '@imo-tikuwa/vue3-bootstrap5-composables'

const confirmModal = useConfirmModal()

const handleClick1 = () => {
  confirmModal.show({
    title: 'Confirm1',
    content: 'Primary Color Button Clicked.',
    ok: async () => {
      console.log('OK Clicked.')
    }
  })
}
</script>

alternatively, you can call it directly from $confirmModal.show inside the <template> section

<template>
  <button
    type="button"
    class="btn btn-warning"
    @click="
      $confirmModal.show({
        title: 'Confirm3',
        content: 'Warning Color Button Clicked.',
        okText: '〇',
        okClass: 'btn-success w-25',
        cancelText: '×',
        cancelClass: 'btn-warning w-25',
        ok: handleOk
      })
    "
  >
    show
  </button>
</template>

ComposableToastPlugin

  1. import plugin.
import { createApp } from 'vue'
import App from './App.vue'

import { ComposableToastPlugin } from '@imo-tikuwa/vue3-bootstrap5-composables'

createApp(App).use(ComposableToastPlugin).mount('#app')
  1. append ToastContainer component in root Vue file(App.vue).
  <div class="container">
    <router-view />

    <ToastContainer />
  </div>

It is possible to install multiple containers. Note that you need to designate a unique group name using the group property for each ToastContainer.

  <div class="container">
    <router-view />

    <ToastContainer />

    <!-- Second ToastContainer with group="another-toast-container" -->
    <ToastContainer :position="'bottom-left'" :group="'another-toast-container'" />
  </div>
  1. wrote codes on the page where you want to display the composable toast. import useToast composable and call show method.
<script setup lang="ts">
import { useToast } from '@imo-tikuwa/vue3-bootstrap5-composables'

const toast = useToast()

const someFunction = () => {
  toast.show({
    title: 'Toast Title',
    content: 'Toast Content',
    delay: 5000,
    animation: true,
    theme: 'info',
    mode: 'basic',
  })
}
</script>

If you want to display in a group other than the default, specify the 'group' option explicitly.

const someFunction = () => {
  toast.show({
    ~~~
    group: 'another-toast-container',
  })
}

This setup allows for the installation of multiple ToastContainer components with unique group names, enabling separate management of toasts across different groups.

The toast message can also be called directly from $composableToast.show in the <template> section.

<template>
  <button
    type="button"
    class="btn btn-warning"
    @click="
      $composableToast.show({
        content: 'This is Simple Info Toast.',
        theme: 'info',
        mode: 'simple',
        group: 'another-toast-container'
      })
    "
  >
    show
  </button>
</template>

ToastContainer Props

| Prop | Default Value | Required | Possible Values | Description | |------------|---------------|----------|---------------------------------------------------|------------------------------------------------| | group | undefined | | Any string | Defines the group for toast container | | position | 'top-right' | | 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | Specifies the position of the toast container. |

useToast show Method Options

| Option | Default Value | Required | Possible Values | Description | |-----------|---------------|----------|------------------------------------------------|-------------------------------------------------| | title | undefined | | Any string | Specifies the title of the toast title. When the 'mode' is set to 'simple', the 'title' option value will not be displayed. | | content | undefined | ✓ | Any string | Sets the content of the toast message.| | delay | 5000 | | Any positive number | Sets the delay time (in milliseconds) before the toast disappears.| | animation | true | | true / false | Determines whether the toast animation is enabled or not. | | theme | primary | | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark' | Sets the theme/color of the toast. | | mode | basic | | 'basic' | 'simple' | Specifies the mode of the toast. | | group | undefined | | Any string | Defines the group for the toast. |