twigs icon indicating copy to clipboard operation
twigs copied to clipboard

Ability to pass `position` to `toast`

Open justin22 opened this issue 6 months ago • 3 comments

Is your feature request related to a problem? Please describe. Currently toast position is handled at Toast component. This prevents us having toast at different positions based on the toast context. For example, certain toast I would want in left bottom and some others on the bottom-center.

Describe the solution you'd like

  • Keep a default position in the Toast component.
  • while using toast hook, accept a positionprop.
<Button
  onClick={() => {
    toast({
      title: "Toast title",
      position: 'top-right',
    });
  }}
>
 Show Toast
</Button>

justin22 avatar Aug 23 '24 06:08 justin22