What can I do when types are missing for a component? (using Toast component) #1270
-
I wanted to customize the button color for the Toast component to make it look better. But when I tried to use the documented Here is the doc for Toast (see the props tab): Here is the source for the types: As you can see, I guess there will be more missing types. Is there anything I can do to make it work temporarily, before the types can be added to the main branch? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Can you share the specific error? When customizing a component via style props you don't provide types, you just provide a key and value (attribute and value) such as: <Toast buttonAction="btn variant-filled-primary" /> edit Reading your message again, I see what you mean - you're trying to customize it via the Essentially you have two ways to customize toast specifically:
We don't support you passing component props values within ToastSettings, however you can use You'll want to use the Tailwind arbitrary selector syntax: The And you'll want to affect the button child element here: So the syntax would be something like: const toastSettings: ToastSettings = {
// ...
class: '[&>button]:!bg-green-500'
// ...
} (obviously the component prop is a lot simpler in this scenario!) |
Beta Was this translation helpful? Give feedback.
-
Hello, don't know if the source code for the toat changed, but I was able to manipulate the button with this tailwind syntax:
The solution mentioned above was not working on my case. |
Beta Was this translation helpful? Give feedback.
Can you share the specific error?
When customizing a component via style props you don't provide types, you just provide a key and value (attribute and value) such as:
edit
Reading your message again, I see what you mean - you're trying to customize it via the
ToastSettings
data.Essentially you have two ways to customize toast specifically:
ToastSettings
for one-off changes per toast instance (per message if you will)We don't support you passing component props values within ToastSettings, however you can use
classes
to targ…