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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@antify/template-module

v0.0.5

Published

![Nuxt](https://img.shields.io/badge/Nuxt-3-green)

Readme

@antify/template-module

Nuxt

A powerful Nuxt module providing a high-level UI layer for the Antify ecosystem. It seamlessly integrates @antify/ui and adds a set of smart, logic-heavy components and client-side utilities to accelerate your development workflow.

Features

  • 🚀 Zero Config Auto-Imports: Use any component without manual imports.
  • 🎨 Seamless @antify/ui Integration: All base components (prefixed with Ant) are available out of the box.
  • 🧠 Smart Logic Components: Specialized components (prefixed with AntTemplate) with built-in logic.
  • 🍞 Built-in Toaster: Simple global API to trigger success or error notifications.
  • 🧪 Advanced Validation: The useFormField utility to bridge Yup validation with UI states.
  • 🛠 Client-Side Toolbox: Composables for CRUD routing, error handling, and state detection.

Installation

Add the module to your project:

pnpm add @antify/template-module

Then, add it to your nuxt.config.ts:

export default defineNuxtConfig({
  modules: [
    '@antify/template-module'
  ]
})

Configuration

You can customize the module behavior via the templateModule key:

export default defineNuxtConfig({
  templateModule: {
    /**
     * Absolute or relative path to your custom tailwind.css file.
     * Use this to inject custom @theme blocks or plugins.
     */
    tailwindCSSPath: '@/assets/css/tailwind.css'
  }
})

Usage

Components

The module automatically exports components from both the UI library and the template layer.

  • Base UI components
    Prefixed with Ant (e.g. <AntButton />)

  • Logic-driven template components
    Prefixed with AntTemplate (e.g. <AntTemplateSaveButton />)

<template>
  <div>
    <AntButton>Button</AntButton>

    <AntTemplateSaveButton @click="handleSave" />
  </div>
</template>

Toaster Plugin

Trigger notifications from anywhere in your app using the $templateModule helper. The toaster is intended for global, non-blocking feedback such as:

  • API success or error messages
  • Redirect notifications
  • Form submission feedback
const { $templateModule } = useNuxtApp();

// Success Notification
$templateModule.toaster.toastSuccess('Success message');

// Error Notification
$templateModule.toaster.toastError('Error message');

Composables (useUiClient)

The useUiClient() composable is the main entry point for all client-side helpers. It exposes grouped utilities such as utils (forms, routing) and handler (response handling).

Form Validation with useFormField Wraps a validation function (e.g., a Yup schema check) and returns reactive properties ready for use with Antify UI components.

<script setup lang="ts">
import {
useUiClient,
ref,
} from '#imports'
import {
  string
} from 'yup';
  
const { utils } = useUiClient();

const mySchema = string().required('This field is required');
const val = ref('');

const { errors, state, validate } = utils.useFormField(async () => {
  // Your yup validation logic
  await mySchema.validate(val.value);
});
</script>

<template>
  <AntTextInput 
    v-model="val"
    :messages="errors" 
    :state="state" 
    @validate="validate"
  />
</template>

CRUD Routing Easily manage navigation and state detection (Create vs. Update page) within your application.

const { utils } = useUiClient();
const { isCreatePage, isUpdatePage, getDetailRoute, isListingPage, isDetailPage } = utils.useCrudRouting(
  'users-id', // Detail route name
  'users'    // Listing route name
);

Response Handling Automate repetitive tasks like handling 404s or fatal errors during data fetching.

const { handler } = useUiClient();

// Handles "not found" data from API and redirects with a toast message
await handler.handleNotFoundResponse(response, '/fallback-url');

// Throws a fatal Nuxt error if a fetch error occurs
handler.handleResponseError(error);

Development

  1. Clone this repository

  2. Install dependencies:

   pnpm install
  1. Start the playground:
   pnpm dev

License

MIT License