SplitButtonWithDrop

Type: React component

How to get SplitButtonWithDrop?

JavaScript

import { SplitButtonWithDrop } from 'fds/components';

A DropButton which renders two Button components with the specified props.

The two buttons are visually "split" by a border within the same container. The first button has the specified label and icon and executes the specified onClick handler. The second one is rendered only with an angle-down (or angle-up) icon and controls the state of the drop.

If a click handler on the first button isn't desired and the button should only toggle the drop, consider using ButtonWithDrop instead.

Props

  1. icon

    (Optional)

    Type: String

    The name of the icon displayed in the component.

    This should be one of the FontAwesome (v5 Pro) icon names with an optional style prefix ('far ' is the default prefix). For more info, see the Font Awesome concept page.

    Default value

  2. isDisabled

    (Optional)

    Type: Boolean

    Whether or not the component should be rendered in a disabled state.

    Default value

  3. isDropButtonDisabled

    (Optional)

    Type: Boolean

    Whether or not the drop button should be rendered in a disabled state.

    Default value

  4. isSelected

    (Optional)

    Type: Boolean

    Whether or not the component should be rendered in a selected state.

    Default value

  5. label

    (Optional)

    Type: String

    The human readable label displayed in the component.

    Default value

  6. onClick

    (Required)

    Type: Function

    A callback that is called whenever the component is clicked and is not in a disabled state.

    For more information about React and "events", check the React documentation

    Arguments

  7. renderDrop

    (Required)

    Type: Function

    A callback that is called at every render of this component. Expects a valid React component instance of the desired drop and its contents to be returned.

    Arguments

  8. tooltipContent

    (Optional)

    Type: String | ReactElement

    The content of the tooltip that is displayed when hovering over the whole component.

    • string: the textual content of the tooltip

    • ReactElement: a React Element (instance of a React Component, usually created with JSX)

    Default value

  9. type

    (Optional)

    Type: String

    Allows you to override the background and border color from its default values (which are based on the context where you use the button; masthead / masthead tab buttons / toolbar) to one of either:

    • 'default'

    • 'primary'

    • 'transparent'

    • 'warning'

    • 'error' Defaults to 'default', which is then interpreted based on the context.

    Please visit the Button playground example for visual examples for each type in each context.

    Default value