Giter VIP home page Giter VIP logo

yombal-ui's Introduction

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.

yombal-ui's People

Contributors

alphajoop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.