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

visio-react-base

v1.3.3

Published

Visio react base a repo designed to contained basic reusable elements in order to build a React app

Downloads

4

Readme

Visio React Base

Visio react base a repo designed to contained basic reusable elements in order to build a React app

Installation

yarn:

yarn add visio-react-base

npm:

npm install visio-react-base

Components

We use formik, material ui and yup, all the different form input types are designed to work with these 3 tools and are expected to be inside a formik form.

Input

Component design to represent input fields to users, accepts text and numbers defaulting to "text" if "type" is not passed. For more info see TextField in MUI.

Usage:

import { Input } from 'visio-react-base';

<Input
    name="firstName"
    label="First Name"
    fullWidth
/>

<Input
    name="age"
    label="Age"
    type="number"
    fullWidth
/>

Phone

Component designed to mask input fields as 10 digits US formatted phone numbers. For more info see TextField in MUI.

Usage:

import { Phone } from 'visio-react-base';

<Phone
    name="phone"
    label="phone"
    fullWidth
/>

Currency

Component designed to mask input fields as US formatted currency. Component will send data back to form as a float. We can pass how many decimal points and and max value, by default will be 2 and 9999999999. For more info see TextField in MUI.

Usage:

import { Currency } from 'visio-react-base';

<Currency 
    name="price"
    label="Price"
    decimalPoints={2}
    maxValue={1000}
    fullWidth 
/>

Checkbox

Component designed to display boolean values. Component will send data back as true, false.

Usage:

import { Checkbox } from 'visio-react-base';

<Checkbox name="Adult" label="Adult?" fullWidth />

Select

Component designed to display a combobox from an object of properly formatted options Usage:

import { Select } from 'visio-react-base';

const stateData = [
    { value: "FL", label: "FL" },
    { value: "TX", label: "TX" },
    { value: "CA", label: "CA" },
    { value: "NY", label: "NY" },
];

<Select
    name="State"
    label="State"
    options={stateData}
    fullWidth
 />

Radio

Component designed to display a radio from an object of properly formatted options Usage:

import { Radio } from 'visio-react-base';

const contactMethodData = [
    { value: "Phone", label: "Phone" },
    { value: "Email", label: "Email" },
    { value: "Text", label: "Text" },
];

<Radio
    name="ContactMethod"
    label="Contact Method"
    options={contactMethodData}
/>

CardSelect

Component designed to display a group of clickable cards from an object of properly formatted options. We can also pass images to display a card with text and image. Usage:

import { CardSelect } from 'visio-react-base';

const colorOptions = [
    { value: "Blue", label: "Blue" },
    { value: "Red", label: "Red" },
    { value: "White", label: "White" },
];

const vehicleOptions = [
    { value: "Car", label: "Car", img: "https://carimage.com" },
    { value: "Truck", label: "Truck", img: "https://truckimage.com" },
    { value: "Motorcycle", label: "Motorcycle", img: "https://motoimage.com" },
];

<CardSelect
    name="Color"
    label="Color"
    options={colorOptions}
/>

<CardSelect
    name="vehicle"
    label="Vehicle Type"
    options={vehicleOptions}
/>

Bucket

Component designed to display a group of clickable cards from an object of ranges.

  1. lowerValue = higher value, will display value: -{lowerValue: 1, higherValue: 1} => displays "1"
  2. lower value = null, will display higher value or lower -{lowerValue: null, higherValue: 10} => displays "10 or lower"
  3. higher value = null, will display lower value or higher -{lowerValue: 10, higherValue: null} => displays "10 or higher"
  4. higher value > lower value, will display range -{lowerValue: 10, higherValue: 20} => displays "10 - 20"

if we pass displayUnknown = true, it will display a bucket named "unknown"

Usage:

import { Bucket } from 'visio-react-base';

const creditRanges = [
    { lowerValue: null, higherValue: 680, value: 680 },
    { lowerValue: 680, higherValue: 719, value: 719 },
    { lowerValue: 720, higherValue: 759, value: 759 },
    { lowerValue: 760, higherValue: null, value: 760 }
];

<Bucket 
    name="creditScore" 
    label="Credit Range" 
    options={creditRanges} 
    displayUnknown={true} 
/>