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

@rut-cl/react-native

v0.1.7

Published

🇨🇱 React Native utilities and input component for Chilean RUT validation powered by rut-cl.

Readme

@rut-cl/react-native

npm version npm downloads bundle size license typescript react-native

Componentes y hooks de React Native para la validación y formateo de RUT chileno, potenciado por rut-cl.

  • ✅ Componente RutInput listo para usar.
  • ✅ Hook useRut para manejo de estado avanzado.
  • ✅ Formateo automático mientras se escribe.
  • ✅ Soporte completo para TypeScript.
  • ✅ Ultra liviano y optimizado para móviles.

| RUT Personas | RUT Empresas | |:-----|:--------:| | ezgif-250d539470b1607d | ezgif-2965da5cf226d548 |


🇪🇸 Español | 🇺🇸 English


Instalación

npm install @rut-cl/react-native

Uso

Componente RutInput

Un reemplazo para el TextInput estándar que maneja automáticamente el formato y la validación.

import React, { useState } from 'react';
import { RutInput } from '@rut-cl/react-native';

const MyComponent = () => {
  const [rut, setRut] = useState('');

  return (
    <RutInput
      value={rut}
      onChangeText={setRut}
      onChangeRut={({ raw, clean, formatted, isValid }) => {
        console.log(isValid); // true/false
        console.log(clean);   // '123456785'
      }}
      placeholder="12.345.678-5"
      // ... acepta todas las props de TextInput
    />
  );
};

Hook useRut

Ideal para cuando necesitas un control total sobre el estado y la validación en formularios complejos.

import { useRut } from '@rut-cl/react-native';
import { TextInput, Text } from 'react-native';

const MyForm = () => {
  const { 
    rawValue, 
    formattedValue, 
    cleanValue, 
    isValid, 
    error, 
    setRawValue 
  } = useRut('');

  return (
    <>
      <TextInput 
        value={formattedValue} 
        onChangeText={setRawValue} 
      />
      {error && <Text color="red">{error}</Text>}
      <Text>Válido: {isValid ? 'Sí' : 'No'}</Text>
    </>
  );
};

Componente RutDisplay

Muestra un RUT formateado correctamente. Si el RUT es inválido, puede mostrar un valor de respaldo.

import { RutDisplay } from '@rut-cl/react-native';

<RutDisplay 
  value="123456785" 
  fallback="RUT No disponible"
  showInvalid={false} // Oculta si es inválido
/>

Hook useRutFormatter

Utilidades rápidas para formatear y validar sin manejar estado interno.

import { useRutFormatter } from '@rut-cl/react-native';

const { formatRut, validateRut, getVerifier } = useRutFormatter();

const formatted = formatRut('123456785'); // '12.345.678-5'
const isValid = validateRut('12.345.678-5'); // true

Referencia de API

RutInput Props

Extiende de TextInputProps de React Native.

| Prop | Tipo | Descripción | | :--- | :--- | :--- | | value | string | El valor actual del input. | | onChangeText | (value: string) => void | Se llama cuando el texto cambia (devuelve valor formateado). | | onChangeRut | (data: OnChangeRutParams) => void | Devuelve un objeto detallado con raw, clean, formatted e isValid. |

useRut(initialValue, options)

| Opción | Tipo | Defecto | Descripción | | :--- | :--- | :--- | :--- | | autoFormat | boolean | true | Indica si el valor devuelto debe formatearse automáticamente. |


Licencia

MIT © Jose Duin