yarn add @twilio-paste/Status - or - yarn add @twilio-paste/core
import {
StatusMenu,
StatusMenuBadge,
StatusMenuItem,
StatusMenuItemChild,
useStatusMenuState,
StatusMenuItemRadio,
StatusMenuItemCheckbox,
} from '@twilio-paste/core/status';
const ProcessStatusMenu = () => {
const [process, setProcess] = React.useState(ProcessObject.Success);
const menu = useStatusMenuState();
const onClick = (status) => {
setProcess(ProcessObject[status]);
menu.hide();
};
return (
<>
<StatusMenuBadge {...menu} i18nButtonLabel="Change account" variant={process.variant}>
{process.children}
</StatusMenuBadge>
<StatusMenu {...menu} aria-label="Preferences">
<StatusMenuItem {...menu} onClick={() => onClick('Success')} variant="default">
<StatusMenuItemChild variant="ProcessSuccess">Complete</StatusMenuItemChild>
</StatusMenuItem>
<StatusMenuItem {...menu} onClick={() => onClick('Neutral')} variant="default">
<StatusMenuItemChild variant="ProcessNeutral">In review</StatusMenuItemChild>
</StatusMenuItem>
<StatusMenuItem {...menu} onClick={() => onClick('Warning')} variant="default">
<StatusMenuItemChild variant="ProcessWarning">Needs attention</StatusMenuItemChild>
</StatusMenuItem>
<StatusMenuItem {...menu} onClick={() => onClick('Error')} variant="default">
<StatusMenuItemChild variant="ProcessError">Rejected</StatusMenuItemChild>
</StatusMenuItem>
<StatusMenuItem {...menu} onClick={() => onClick('InProgress')} variant="default">
<StatusMenuItemChild variant="ProcessInProgress">In-progress</StatusMenuItemChild>
</StatusMenuItem>
<StatusMenuItem {...menu} onClick={() => onClick('Disabled')} variant="default">
<StatusMenuItemChild variant="ProcessDisabled">Paused</StatusMenuItemChild>
</StatusMenuItem>
<StatusMenuItem {...menu} onClick={() => onClick('Draft')} variant="default">
<StatusMenuItemChild variant="ProcessDraft">Draft</StatusMenuItemChild>
</StatusMenuItem>
</Menu>
</>
);
};
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.
element
Overrides the default element name to apply unique styles with the Customization Provider
- Type
any
- Default
STATUS_MENU_BADGE
variant
Sets the display style of the Status Menu Badge
- Type
any
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.
variant RequiredRequired
Sets the display style of the Status Menu Item
- Type
StatusBadgeVariants
element
Overrides the default element name to apply unique styles with the Customization Provider
- Type
any
- Default
MENU_ITEM_STATUS
Inherited props
Paste components will often extend native HTML elements and as a result will inherit or extend their available properties. Below is a list of the props this component has inherited and are also available to use.