Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@flexcodelabs/dropdown

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flexcodelabs/dropdown

@flexcodelabs/dropdown

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

@flexcodelabs/dropdown

npm NPM

Package Name

Features

  • List of features

Installation

npm install @flexcodelabs/dropdown

or

yarn add @flexcodelabs/dropdown

Usage

...
import Dropdown from '@flexcodelabs/dropdown';

const Test = () => {
  const [open, setOpen] = React.useState(false);
  const Children = () => {
    return (
      <div
        style={{
          backgroundColor: "white",
          boxShadow: "0px 0px 10px rgba(0, 0, 0, 0.1)",
          padding: "10px",
          display: "flex",
          flexDirection: "column",
          alignItems: "flex-start",
          gap: "10px",
          width: "200px",
        }}
      >
        <button
          onClick={() => setOpen(!open)}
          style={{
            backgroundColor: "transparent",
            border: "none",
            fontSize: 16,
            padding: 0,
          }}
        >
          Closes dropdown
        </button>
        <li
          style={{
            backgroundColor: "transparent",
            border: "none",
            listStyle: "none",
            fontSize: 16,
          }}
        >
          List Item
        </li>
      </div>
    );
  };
  const Toggle = (
    <div>
      <button onClick={() => setOpen(!open)}>Toggle</button>
    </div>
  );

  return (
    <div>
      <div
        style={{
          position: "relative",
        }}
      >
        <Dropdown
          open="up"
          Toggle={Toggle}
          isOpen={open}
          close={() => setOpen(false)}
        >
          <Children />
        </Dropdown>
      </div>
    </div>
  );
};
/>

Examples

Source code

Props

NameTypeDefaultRequiredDescription
ToggleReactNodenulltrueToggle component
childrenreactNodenulltrueDropdown contents
classNamestringnullfalse
isOpenbooleannullfalsedropdown open status
closeFunc()nullfalseclose dropdown function
styleCSSPropertiesnullfalsecustom styles
dropdownstylesCSSPropertiesnullfalsecustom dropdown styles
openleft, right, up, down, left-center, down-center, up-center or right-centerdownfalseopen position of the dropdown

FAQs

Package last updated on 31 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc