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

@mohamedhemidi/vault-ui

v2.1.8

Published

Reusable UI componentes for React and Next

Downloads

28

Readme

Vault UI

Table of Contents

  1. Installation
  2. Buttons components
  3. Input text components
  4. Select components
  5. Lazy Load Image Component
  6. Toast Component
  7. API references and Usage

Installation

 npm install @mohamedhemidi/vault-ui

Buttons components

Simple buttons

<Button color="primary">Primary Button</Button>
<Button color="success">Success Button</Button>

When using Icons it's highly recommended to use Google svg icons as they support re-coloring with fill attribute.

 <Button
    icon={<EditIcon />}
    variant="outlined"
    size="small"
    color="primary"> Primary Outlined Button with Icon</Button>

image

Input text components

Simple input texts

<TextField label="Email" color="primary" type="text" name="username" />
<TextArea
    label="Summary"
    color="success"
    name="summary"
/>

Input with Error :

<TextField
    label="Username"
    error
    errorMessage="Username is already taken, try another"
    color="primary"
    type="text"
    name="username"
/>
<TextArea
          label="Description"
          color="success"
          name="description"
          error
          errorMessage="Please write a description"
/>

image

image

Select components

image

Example of usage:

const options = [
  { label: "First", value: 1 },
  { label: "Second", value: 2 },
  { label: "Third", value: 3 },
  { label: "Fourth", value: 4 },
  { label: "Fifth", value: 5 },
];
function App() {
    const [value1, setValue1] = useState<SelectOption[]>([options[0]]);
    const [value2, setValue2] = useState<SelectOption | undefined>(options[0]);
    
    return (
         <Select
          multiple
          options={options}
          value={value1}
          onChange={(o) => setValue1(o)}
        />
        
        <Select
          options={options}
          value={value2}
          onChange={(o) => setValue2(o)}
        />
    )
}

Lazy Load Image Component

image

Example of usage:

<LazyLoadImage 
src={'your_image_path'} alt='alt text' borderRadius="2rem" />

Toast Component

image

A light and responsive notifications toasts component:

const [active, setsActive] = useState(false);

<Toast
    message="You signed up successfully" // Toast message
    timer={6} // 6 seconds to close
    active={active} // 
    close={() => setsActive(false)}
/>

API References and Usage

API references doc for the button component and usage

  | Name | Type | Default | Description | |----------|-----------------------------------------------------------------------------------|---------|----------------------------------------------------------------------------------------------------------| | children | node | - | The content of the button | | color | |"primary" |"secondary" |"info" |"warning" |"danger" |"success" |"neutral" | primary | The background color of the button | | size | |"small" |"medium" |"large" | small | The size of the button | | variant | |"outlined" |"ghost" |"filled" |"shadow" | filled | The variant shape to use | | rounded | boolean | false | If true the button will be rounded ⚠️ If true, the button accepts only icons and No text or children | | disabled | boolean | false | If true button will be disabled | | loading | boolean | false | If true a loading spinner shows and button will be disabled | | icon | node | - | svg element placed at the beginning of the button , ⚠️ Google icons are recomended | | width | number | auto | Width size in rem unit | | height | number | auto | Height size in rem unit |

API References for Text Field component

 

| Name | Type | Default | Description | |--------------|-----------------------------------------------------------------------------------|---------|-----------------------------------------------| | color | |"primary" |"secondary" |"info" |"warning" |"danger" |"success" |"neutral" | primary | The color of the input outline | | label | text | - | The label text of the input | | placeholder | text | - | The placeholder text of the input | | error | boolean | false | If true the borders and label get a red color | | errorMessage | text | - | The error message in case of validation error | | disabled | boolean | false | If true button will be disabled | | width | number | auto | Width size in rem unit |

API References for Text Area component

 

| Name | Type | Default | Description | |--------------|-----------------------------------------------------------------------------------|---------|-----------------------------------------------| | color | |"primary" |"secondary" |"info" |"warning" |"danger" |"success" |"neutral" | primary | The color of the input outline | | label | text | - | The label text of the input | | placeholder | text | - | The placeholder text of the input | | error | boolean | false | If true the borders and label get a red color | | errorMessage | text | - | The error message in case of validation error | | disabled | boolean | false | If true button will be disabled | | width | number | auto | Width size in rem unit |

API References for Select component

 

| Name | Type | Default | Description | |----------|---------|---------|-----------------------------------------------------------------------------| | multiple | boolean | false | If true the select accept multi selection and | | options* | array | - | An array of key value objects, ex : [{label: "Item 1", value: "items-one"}] | | value* | array | - | An array of key value Object , usually set in component state. |

API References for Lazy Load Image component

 

| Name | Type | Default | Description | |---------------|--------|---------|------------------------------------------------------------------------------------------------------------------------------| | src | string | - | The path to the image | | alt | string | - | Alt text for SEO | | fallbackImage | string | - | The path for the small size bitmap image that displays while loading, an auto base64 image is generated if this not provided | | borderRadius | string | 0 | The radius of the image in string with unit eg: "3rem" , "15px" |