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

@maggioli-design-system/mds-dropdown

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maggioli-design-system/mds-dropdown

mds-dropdown is a web-component from Magma Design System, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScirpt framework you are using.

  • 4.5.2
  • npm
  • Socket score

Version published
Weekly downloads
147
decreased by-45.35%
Maintainers
2
Weekly downloads
 
Created
Source

mds-dropdown

Best practices of usage

There are many situations where the component should be placed on the surface of the document:

<body>
  <mds-dropdown target="ui-content">
    <mds-text>Dropdown contents</mds-text>
  </mds-dropdown>
  <div>
    <mds-text>Deep contents</mds-text>
    <div>
      <mds-text id="ui-content">Deeper contents</mds-text>
    </div>
  </div>
</body>

The next use case couldn't be rendered correctly depending by relative/absolute/etc. positioning and strategy attribute mix.

<body>
  <div>
    <mds-text>Deep contents</mds-text>
    <div>
      <mds-text id="ui-content">Deeper contents</mds-text>
      <mds-dropdown target="ui-content">
        <mds-text>Dropdown contents</mds-text>
      </mds-dropdown>
    </div>
  </div>
</body>

Affected problems:

  • Wrong backdrop render
  • Wrong mds-dropdown positioning

This is a web-component from Maggioli Design System Magma, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScirpt framework you are using.

Properties

PropertyAttributeDescriptionTypeDefault
arrowarrowIf set, the component will have an arrow pointing to the caller.booleantrue
arrowPaddingarrow-paddingSets the distance between arrow and dropdown margins.number24
autoPlacementauto-placementIf set, the component will be placed automatically near it's caller.booleanfalse
backdropbackdropSpecifies if the component has a backdrop backgroundbooleanfalse
flipflipSpecifies the placement of the component if no space is available where it is placed.booleanfalse
offsetoffsetSets distance between the dropdown and the caller.number24
placementplacementSpecifies where the component should be placed relative to the caller."bottom" | "bottom-end" | "bottom-start" | "left" | "left-end" | "left-start" | "right" | "right-end" | "right-start" | "top" | "top-end" | "top-start"'bottom'
shiftshiftIf set, the component will be kept inside the viewport.booleantrue
shiftPaddingshift-paddingSets a safe area distance between the dropdown and the viewport.number24
smoothsmoothIf set, the component will follow the caller smoothly, visible when the page scrolls.booleantrue
strategystrategySets the CSS position strategy of the component."absolute" | "fixed"'fixed'
target (required)targetSpecifies the id of the caller element.stringundefined
visiblevisibleSpecifies the visibility of the component.booleanfalse
zIndexz-indexSpecifies the visibility of the component.numberundefined

Events

EventDescriptionType
mdsDropdownChangeEmits when a modal is visible or hiddenCustomEvent<MdsDropdownEventDetail>
mdsDropdownHideEmits when a modal is hiddenCustomEvent<MdsDropdownEventDetail>
mdsDropdownVisibleEmits when a modal is visibleCustomEvent<MdsDropdownEventDetail>

Slots

SlotDescription
"default"Add text string, HTML elements or components to this slot, elements will be shown when the component is triggered.

CSS Custom Properties

NameDescription
--mds-dropdown-arrow-backgroundSets the fill color of the arrow.
--mds-dropdown-backdrop-durationSets the transition duration of the backdrop, used by component's code too.
--mds-dropdown-backdrop-z-indxSets the backdrop z-index, used by component's code too.
--mds-dropdown-backgroundSets the background-color of the dropdown.
--mds-dropdown-drop-shadowSets the drop-shadow of the dropdown.
--mds-dropdown-durationSets the duration of the dropdown animation.
--mds-dropdown-easeSets the easing of the dropdown animation.
--mds-dropdown-transform-fromSets the from animation transform of the dropdown.
--mds-dropdown-transform-toSets the to animation transform of the dropdown.
--mds-dropdown-z-indexSets the z-index of the component.

Built with love @ Gruppo Maggioli from R&D Department

FAQs

Package last updated on 20 Dec 2023

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