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

yombal-ui

v2.1.0

Published

Yombal UI is a library that provides ready-to-use React components for faster development

Downloads

4

Readme

Yombal UI

Welcome to Yombal UI, a library that provides ready-to-use React components for faster development.

Table of Contents

Installation

To install Yombal UI, you can use npm or yarn:

# Using npm
npm install yombal-ui

# Using yarn
yarn add yombal-ui

Usage

Import the components you need from Yombal UI and use them in your React application:

import { ThemeToggle, OtherComponent } from 'yombal-ui';

function App() {
  return (
    <div>
      <h1>Your App</h1>
      <ThemeToggle theme={true} onClick={() => console.log('Theme toggled!')} />
      <OtherComponent />
    </div>
  );
}

export default App;

Theme Toggle

Yombal UI provides a ThemeToggle component that you can use to add a theme toggle button to your application. Here's an example of how to use it:

import { useState } from 'react';
import { ThemeToggle } from 'yombal-ui';

function App() {
  const [isDarkMode, setDarkMode] = useState(false);

  const toggleDarkMode = () => {
    setDarkMode(!isDarkMode);
    // Add logic to update your application's theme
  };

  return (
    <div>
      <h1>Your App</h1>
      <ThemeToggle
        theme={isDarkMode}
        onClick={toggleDarkMode}
        size={24}
        shouldScaleOnHover={true}
        className="custom-styles"
      />
    </div>
  );
}

export default App;

Props

The ThemeToggle component accepts the following props:

  1. theme: A boolean representing the current theme (true for dark, false for light).
  2. onClick: A function to be called when the button is clicked, typically used to toggle the theme.
  3. size: Optional. The size of the toggle button icon.
  4. shouldScaleOnHover: Optional. Enable or disable the hover scaling effect on the button.
  5. className: Optional. Additional CSS classes to customize the button's appearance.

Feel free to customize the ThemeToggle component by adjusting the size, shouldScaleOnHover, and applying custom styles using the className prop. Tailor it to seamlessly integrate into your application's design and provide an enhanced user experience.

Menu Button

The MenuButton component in Yombal UI allows you to easily create a responsive hamburger menu button for your navigation. This button can be used to toggle the visibility of a menu or trigger other actions in your application.

import { useState } from 'react';
import { MenuButton } from 'yombal-ui';

function App() {
  const [isMenuOpen, setMenuOpen] = useState(false);

  const handleMenuClick = () => {
    setMenuOpen(!isMenuOpen);
    // Add logic for handling menu visibility
  };

  return (
    <div>
      <h1>Your App</h1>
      <MenuButton onClick={handleMenuClick} isOpen={isMenuOpen} size={24} />
    </div>
  );
}

export default App;

Props

The MenuButton component accepts the following props:

  1. onClick: A function to be called when the button is clicked.
  2. size: Optional. The size of the button icon.
  3. isOpen: A boolean indicating whether the menu is currently open or closed.
  4. className: Optional. Additional CSS classes to customize the button's appearance.

Feel free to customize the component and its styles to fit your application's design. The button will automatically transition between the menu and close icons based on the isOpen prop.