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 🙏

© 2025 – Pkg Stats / Ryan Hefner

mantine-import-table

v0.2.0

Published

Mantine Import Table

Readme

mantine-import-table

Parse and check your input xlsx / csv file with Zod Scheme By MantineUI.

Works for mantine 7 / 8.

Warning
Still in testing, please do not use in productions.

Features

  • Zod Types friendly & support z.object() scheme import
  • Accept xlsx / csv file input
  • Mantine UI base
  • Ease of use error reminder

Setup / Install

Make sure you have installed zod and @mantine/core items and @mantine/dropzone before using this packages.

If Not:

yarn add @mantine/core @mantine/hooks @mantine/dropzone zod

And Follow the guide with https://mantine.dev/getting-started/

Install packages

yarn add mantine-import-table

Quickstart

import { MantineImportTable } from "mantine-import-table";

// Make sure you have installed @mantine/dropzone
import '@mantine/dropzone/styles.css';

import { z } from "zod"

const testScheme = z.object({
    "Name": z.string().min(1),
    "Student ID": z.number().min(0).max(100),
    "Good": z.enum(["Yes", "No"])
})
export type TestScheme = z.infer<typeof testScheme>;

export default function MainPage() {

    const [ data, setData ] = useState<TestScheme[]>([]);

    return (
        <MantineImportTable
            zodScheme={testScheme}
            successCb={(v) => setData(v)}
        />
    )
}

Props for <MantineImportTable />

  • Require Props

| Name | Require | Type | Description | | -------------------- | ------- | ------------------------------ | --------------------------------------------------------- | | zodScheme | Yes | z.object({}) | Your z.object() scheme | | successCb | No | (data: z.output[]) => void | return your z.object().parse Array after a success input |

Samples:

import { MantineImportTable } from "mantine-import-table";

import { Container } from "@mantine/core";
import { z } from "zod"

const testScheme = z.object({
    "Name": z.string().min(1),
    "Student ID": z.number().min(0).max(100),
    "Good": z.enum(["Yes", "No"])
})
export type TestScheme = z.infer<typeof testScheme>;

export default function MainPage() {

    const [ data, setData ] = useState<TestScheme[]>([]);

    return (
        <MantineImportTable
            zodScheme={testScheme}
            successCb={(v) => setData(v)}
        />
    )
}
  • Optional Props

| Name | Require | Type | Default | Description | | -------------------- | ------- | -------------------------------------- | -------------- | -------------------------------------------------------- | | info | No | InfoColumnsInput[] | [] | Info Array For additional informations | | onReject | No | (fileRejections: FileRejection[]) => void | N/A | Return Reject input files |
| maxFileSize | No | number | 10 * 1024 ** 2 | Max xlsx / csv file size in bytes |
| showDownloadTemplate | No | boolean | true | Display download generated header xlsx template button |
| alertText | No | string | null | undefined | Make sure your file includes all the required columns. | The alert text (Set null / undefinded to hide) |

Params for info: InfoColumnsInput

| Name | Require | Type | Default | Description | | ----------- | ------- | ---------------- | --------- | --------------------------------------------------------- | | key | Yes | string | N/A | Key that match with your Zod Scheme Key (e.g. User ID ) | | type | Yes | string | N/A | Remind User what data should be included in the xlsx (Not Functional, just for display only) | | description | No | string / string | "" | Explain more about the cols header (e.g. Record user id ) |
| examples | No | string | "" | Data examples explains (e.g. Yes | No ) |

Samples:

import { MantineImportTable } from "mantine-import-table";

import { Container } from "@mantine/core";
import { z } from "zod"

const testScheme = z.object({
    "Name": z.string().min(1),
    "Student ID": z.number().min(0).max(100),
    "Good": z.enum(["Yes", "No"])
})
export type TestScheme = z.infer<typeof testScheme>;

export default function MainPage() {

    const [ data, setData ] = useState<TestScheme[]>([]);

    return (
        <MantineImportTable
            zodScheme={testScheme}
            successCb={(v) => console.log(v)}
            info={[
                {
                    key: "Name",
                    type: "string",
                    description: "Enter Student Name",
                    examples: "Peter Wong",
                },
                {
                    key: "Student ID",
                    type: `number`,
                    description: "Enter Student ID",
                    examples: "12",
                },
                {
                    key: "Good",
                    type: `["Yes", "No"]`,
                    description: "Determine is good student",
                }
            ]}
            maxFileSize={1024 ** 2 * 15}
            showDownloadTemplate={false}
        />
    )
}

License

MIT