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

lib-formulario

v0.1.5

Published

Uma Lib React para realizar criação de formulario.   Acesse o [link](https://www.npmjs.com/package/lib-formulario) do repositório do package no site oficial NPM.   Acesse o [link](https://github.com/guiffsouza/lib-formulario) do repositório do G

Downloads

8

Readme

Package lib-formulario

Uma Lib React para realizar criação de formulario.   Acesse o link do repositório do package no site oficial NPM.   Acesse o link do repositório do Github.

Como usar

Para instalar o package bastar rodar o comando abaixo.

$ npm install lib-formulario

Component Input

O Componente Input tem os seguintes tipos 'email', 'text', 'number', 'tel', 'password', 'date', 'datetime'.   Abaixo um exemplo de uso do componente.

import { Input } from 'lib-formulario';

function App() {
  return (
    <>
      <Input
          id='email'
          type='email'
          placeholder='Seu email'
          required={true}
          erro={true}
          messageErro='erro'
          border='normal'
          />
    </>
  );
}

export default App;

O componente <Input/> pode receber os seguintes valores:

| Key | Tipagem | Valor Opcional ? | | ----------- | ---------------------------------------------------------------- | ---------------- | | id | string | Não | | label | string | Sim | | placeholder | string | Sim | | name | string | Sim | | type | 'email', 'text', 'number', 'tel', 'password', 'date', 'datetime' | Sim | | value | string, number | Sim | | maxlength | number | Sim | | erro | boolean | Sim | | messageErro | string | Sim | | border | 'normal', 'none' | Não | | required | boolean | Sim | | mask | boolean | Sim | | valueMask | 'tel', 'date', 'dateFull' | Sim | | onchange | (e: React.ChangeEvent) => void | Sim | | onblur | (e: React.FocusEvent) => void | Sim | | oninvalid | (e: React.FormEvent) => void | Sim |

Você pode passar uma Key mask={true} e valueMask={'tel'} para criar uma máscara (11) 1 1111 - 1111 no input.

Component InputList

O Componente InputList criar um input com listagem.   O Componente recebe um array.   Abaixo um exemplo de como usar o componente.

import { InputList } from 'lib-formulario';

function App() {
  return (
    <>
      <InputList
        label='Mes'
        lista={['janeiro', 'fevereiro']}
        name='mes'
        border='normal'
        required={true}/>
    </>
  );
}

export default App;

O Componente <InputList/> recebe os seguintes valores:

| Key | Tipagem | Valor Opcional ? | | -------- | ------------------------------------------- | ---------------- | | label | string | Sim | | lista | string[] | Não | | name | string | Não | | value | string | Sim | | border | 'normal', 'none' | Sim | | required | boolean | Sim | | onchange | (e: React.ChangeEvent) => void | Sim |

O Component Button

O Componente Button criar um botão.   Abaixo um exemplo de como usar o componente.

import { Button } from 'lib-formulario';

function App() {
  return (
    <>
      <Button type='submit'>Enviar</Button>
    </>
  );
}

export default App;

O Componente <Button/> recebe os seguintes valores:

| Key | Tipagem | Valor Opcional ? | | -------- | ------------------------------------------------ | ---------------- | | type | 'button', 'submit', 'reset' | Não | | children | ReactNode | Não | | color | string | Sim | | onclick | (e: React.MouseEvent) => void | Sim |

Você pode passar uma key color={"#fff"} para mudar a cor do background do botão.