0.0.35 โ€ข Published 6 months ago

react-dropdown-table v0.0.35

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

ReactDropdownTable

A customizable React dropdown table component with dynamic positioning and optional arrow icons.

Installation

To install the component, use npm:

npm install react-dropdown-table
yarn add react-dropdown-table

Usage

Hereโ€™s how to use the ReactDropdownTable component in your React project:

Quick Start

import ReactDropdownTable from "react-dropdown-table";

<ReactDropdownTable button={"Click Me"} position={true} arrow={true}>
    <ul>
        <li>Hello World</li>
        <li>
            <a href="#">Profile</a>
        </li>
        <li>
            <a href="#">Purchase History</a>
        </li>
        <li>
            <a href="#">Logout</a>
        </li>
    </ul>
</ReactDropdownTable>;

Create Custom Button

const handleCustomButton = () => {
    return <div className="your-custom-button"> Click Here </div>;
};

<ReactDropdownTable button={handleCustomButton()} position={true} arrow={true}>
    {/* Your Dropdown Item */}
</ReactDropdownTable>;

Examples

1.Default

Basic usage with default settings:

<ReactDropdownTable button="Menu">
    <ul>
        <li>Option 1</li>
        <li>Option 2</li>
    </ul>
</ReactDropdownTable>

2. Dropdown Without Arrow

To disable the arrow icon, set arrow={false}:

<ReactDropdownTable button="Click Me" arrow={false}>
    <ul>
        <li>Profile</li>
        <li>Settings</li>
    </ul>
</ReactDropdownTable>

3. Dropdown with Dynamic Positioning

The dropdown adjusts its position based on available screen space:

<ReactDropdownTable button="Dynamic Position" position={true}>
    <ul>
        <li>Top</li>
        <li>Bottom</li>
    </ul>
</ReactDropdownTable>

Properties

PropertyTypeDefaultDescription
buttonReactElement, stringRequiredText to display on the button that toggles the dropdown.
positionbooleantrueIf true, the dropdown adjusts position (top/bottom) based on available space.
arrowbooleantrueIf true, an arrow icon will be displayed next to the button text.
childrenReactNodeRequiredThe content to display inside the dropdown, such as a list or other elements.
customStylebooleanfalseIf true then not working default css
classNamestringyour-class-nameYou can pass your custom class and style update
maxWidthstring180pxYou can customize dropdown item width

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Support

For any questions or issues, please contact me via GitHub. ๐Ÿš€

Happy Coding! ๐Ÿš€

0.0.35

6 months ago

0.0.34

6 months ago

0.0.33

6 months ago

0.0.32

6 months ago

0.0.31

6 months ago

0.0.30

6 months ago

0.0.29

6 months ago

0.0.27

6 months ago

0.0.26

6 months ago

0.0.25

6 months ago

0.0.24

6 months ago

0.0.23

6 months ago

0.0.22

6 months ago

0.0.21

6 months ago

0.0.20

6 months ago

0.0.19

6 months ago

0.0.18

6 months ago

0.0.17

6 months ago

0.0.16

6 months ago

0.0.15

6 months ago

0.0.14

6 months ago

0.0.13

6 months ago

0.0.12

6 months ago

0.0.11

6 months ago

0.0.10

6 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.1

6 months ago