Skip to main content

DuplexButton

Components

DuplexButton()

DuplexButton(props, context?): ReactNode

A DuplexButton component is a special type of button that has been customized to satisfy a specific use case. This button will change its label depending on its active and hover state. A DuplexButton component takes all the props of a Button component minus the label and additional customization props as shown below:

Parameters

ParameterType
propsDuplexButtonProps
context?any

Returns

ReactNode

Example

 <DuplexButton
name='dropdown'
customStyle={disabledStyle}
inactiveLabel={t('Follow')}
activeLabel={t('Following')}
activeHoverLabel={t('Unfollow')}
active={following}
/>

Source

libs/design-system-core/src/components/DuplexButton/index.tsx:51

Props

DuplexButtonProps

DuplexButtonProps: Omit <ButtonProps, "label"> & object

Type declaration

MemberType
activeboolean
activeHoverIconReact.ReactElement
activeHoverLabelstring
activeIconReact.ReactElement
activeLabelstring
activeVariantButtonProps["variant"]
allowMinimizationboolean
fixedWidthstring
inactiveLabelstring
inactiveVariantButtonProps["variant"]
onClickActiveEventHandler<SyntheticEvent>
onClickInactiveEventHandler<SyntheticEvent>

Source

libs/design-system-core/src/components/DuplexButton/index.tsx:7