Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Enhanced Offset Interface to config #510

Open
jiwon79 opened this issue Nov 4, 2024 · 1 comment
Open

Feature Request: Enhanced Offset Interface to config #510

jiwon79 opened this issue Nov 4, 2024 · 1 comment

Comments

@jiwon79
Copy link

jiwon79 commented Nov 4, 2024

The current offset property in the Toaster only accepts a string or number to set the --offset CSS property. This limitation means the horizontal and vertical offsets must use the same value. I would like to suggest an interface that allows different values for horizontal and vertical offsets.

Proposed interface:

type Offset =
  | string
  | number
  | {
    horizontal?: string | number;
    vertical?: string | number;
  }

f this type of interface seems acceptable, would it be alright for me to implement it?
Alternatively, if you think another format would be better, I’d really appreciate your feedback.

@jiwon79
Copy link
Author

jiwon79 commented Nov 4, 2024

+) workaround (only applicable when the position is set to right):

By specifying --width in the style and setting a different width for the actual component in toastOptions, it’s possible to adjust the horizontal offset.

<Toaster
  style={{ '--width': '300px' }}
  toastOptions={{
    unstyled: true,
    classNames: {
      success: 'w-100px'
    }
  }}
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant