drop-button

v2.6.5arrow_drop_down
v2.6.5
v2.5.5
STATUS
Passing
DOWNLOADS
160
LICENSE
Apache 2.0
VISIBILITY
Public
PUBLISHED
3 months ago
subject
A Button that controls a Drop. When opened, the Drop will contain
1 contributor
Like
Use drop-button in your project ?
Copied
npm i @bit/grommet.grommet.drop-button
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Component Example
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
modified
chevron_left
chevron_right

DropButton

A Button that controls a Drop. When opened, the Drop will contain whatever is specified via dropContent. The Drop will control the focus so that the contents behind it are not focusable. All properties of Button can be passed through.

Usage

import { DropButton } from 'grommet';
<DropButton dropContent={...} />

Properties

a11yTitle

Custom title to be used by screen readers. Defaults to Open Drop.

string

alignSelf

How to align along the cross axis when contained in a Box or along the column axis when contained in a Grid.

start
center
end
stretch

gridArea

The name of the area to place this inside a parent Grid.

string

margin

The amount of margin around the component. An object can be specified to distinguish horizontal margin, vertical margin, and margin on a particular side.

none
xxsmall
xsmall
small
medium
large
xlarge
{
  bottom: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string,
  horizontal: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string,
  left: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string,
  right: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string,
  top: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string,
  vertical: 
    xxsmall
    xsmall
    small
    medium
    large
    xlarge
    string
}
string

disabled

Whether the button should be disabled.

boolean

dropAlign

How to align the drop with respect to the button. Defaults to { "top": "top", "left": "left" }.

{
  top: 
    top
    bottom,
  bottom: 
    top
    bottom,
  right: 
    left
    right,
  left: 
    left
    right
}

dropContent

Required. Content to put inside the Drop.

element

dropTarget

Target where the drop will be aligned to. This should be a React reference. Typically, this is not required as the drop will be aligned to the DropButton itself by default.

object

dropProps

Any valid Drop prop.

object

onClose

Callback for when the drop is closed

function

onOpen

Callback for when the drop is opened

function

open

Whether the drop should be open or not. Setting this property does not influence user interaction after it has been rendered.

boolean

Intrinsic element

button