@squiz/xaccel-overflow-menu
TypeScript icon, indicating that this package has built-in type declarations

1.15.1 • Public • Published

Overflow Menu

Description

The Overflow Menu component hides items that don't fit in the available space and shows them in a dropdown menu. It automatically adjusts when the window size changes or when items are added or removed. The Overflow Menu contains an option to add a custom button triggering the menu.

Components properties

Property Name Property description Property Type IsRequired
addOwnButton Whether to add a custom button to trigger the overflow menu. bool
ownButtonProps Properties for the custom overflow button if addOwnButton is true. object
children The items to display inside the overflow menu. ReactNode
className Overwrite ClassName classNameOverride
...divProps Any other properties a div element supports. -

For more information about className please visit packages/utility/functions/src/generateClasses.js

Props Example:

<OverflowMenu
    addOwnButton={true}
    ownButtonProps={{ label: 'More', showIconOnly: true }}
    className="customClass"
>
    <li>Item 1</li>
    <li>Item 2</li>
</OverflowMenu>

Usage

Install the package by running: npm i @squiz/xaccel-overflow-menu

import { OverflowContainer, OverflowMenu, OverflowMenuButton} from '@squiz/xaccel-overflow-menu';

function SomeReactComponent() {
    <OverflowContainer>
        <OverflowMenu>
            <li>Item 1</li>
            <li>Item 2</li>
        </OverflowMenu>
        <OverflowMenuButton label="Click here to open" showIconOnly={false} className="MyButton" />
    </OverflowContainer>
}

Readme

Keywords

none

Package Sidebar

Install

npm i @squiz/xaccel-overflow-menu

Weekly Downloads

0

Version

1.15.1

License

ISC

Unpacked Size

38.9 kB

Total Files

14

Last publish

Collaborators

  • squiz-npm-publish
  • cdloh
  • pcoshansquiz
  • tadams_squiz
  • abarnes_squiz
  • gsherwood
  • pnolland
  • chadszinow-squiz
  • deborahsherwood
  • griseborough
  • akarelia
  • sdanis
  • tbernardes
  • oliverneal
  • azakens
  • azenderowska.squiz
  • lnowak
  • mdobie
  • bmatters
  • ewyatt
  • lwright-sq
  • cupreti
  • jmatthew_squiz
  • wjarosz
  • bxwu
  • carlfoster
  • samort
  • yyang1029
  • squiz-dwebster
  • tsmyth
  • aqureshi-sqz
  • rainger_squiz
  • ajhawar
  • hlee_squiz_npm
  • uqureshi
  • thomasgrob
  • avanschoor-squiz
  • ata-squiz
  • asharpe-squiz
  • aj12
  • squiz-lstephan
  • squiz-ncallahan
  • squiz-dschoen
  • squiz-ksilalahi
  • jpolgar-squiz
  • pkiriakou
  • hnarayanasamy
  • rmcavoy-squiz
  • asittirangsan
  • jchaware
  • lunowak-squiz
  • mnowakowski1
  • sholloway
  • pantyporowicz-squiz
  • djarrott.squiz.net
  • dkaczmarek
  • lineenan
  • aaronchan1010
  • haleesquiz
  • dpedroso
  • rszarafinski
  • tmadden
  • zackyang214
  • gdemelloesilva.squiz
  • jwrobel
  • bpottier
  • hkapoor_squiz
  • jhendersonsquiz
  • joshsquiz
  • dstaskiewicz
  • cross-squiz
  • sjamesquiz
  • dheffernan