You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dialogs: Provide ability to set different color/font style for title #3830
Currently the default label color per styles is applied to both the contents of the dialog and also the title. It will be nice to have ability to specify different colors - one for title and one for the message.
Reason for this is that I want to mimic as closely as possible the default iOS alert style - i.e. bold blue title and black text. From what I see with the current implementation this is not possible.
Hi @PeterStaev,
Thank you for your suggestion.
One option to change the color of the Label and Button text is to Applying a global CSS style color to Label and Button, which will also affect the style of dialogs.
Regarding that, another option is to use non-fullscreen modal page, which will allow you to style the child components inside it as you wish and to set up the Color and the FontStyle of the text.
Hi @tsonevn , I've tried putting that style in app.css but seems it does not have any effect (I'm using {N} w/o Angular). Also wont that again style all the text on the dialog? What I want to achieve is when I use this:
The "Success" word to be bold/black (or whatever the default iOS style is) while the text "Contact Saved!" to be whatever style I've setup for Label/Dialog. Instead I'm getting this:
Which makes the title indistinguishable from the message.
Hi @PeterStaev.
Excuse me if I was not clear enough,
My question was if it is applicable for you, such a dialog selector to be created in the feature for some of the next NativeScirpt versions.
Regarding that, if I understand you correctly, you would like to change the style for each dialog individually.
This would be really great for styling a Delete option different from the rest of the options. For example, Delete in this list should be styled differently, like with red bold text (examples of this are in many iOS applications)
Reacted by Witold, Federico Dal Colle, b02505048, Anurag Dwivedi, Jeff Lam, yasser, Shane Rosenthal, Darren Houston, Dariusz and Brian Clow
if Dialog can have some extra property like 'cssClass' which can be set when creating dialog and this class will be added to dialog layout container then it will be very nice feature have.
+1
Reacted by Alice Selezneva, Ahnert1, tahir jamil, Fatih Ulusoy, Lochlan, rronichen, Jônatas Dourado Porto, Dmitriy and Michelle Grasso
Obviously complete CSS control would be ideal. In the mean time we could add an option to use destructiveButtonText as an alternative to cancelButtonText for alert. It would then apply the destructive style (red) on iOS.
Reacted by Chris Johns, jim, diego, Kent and ishiharas
Right now this feature is more important due to the iOs 13 dark mode.
Now by default, without specifing otherwise, in dark mode the Label color is white!, so if we want our texts to be dark we must style the labels, afecting this to the dialogs too.
So we need urgently the ability to distinguish between plain label or dialogs texts.
Reacted by Lochlan, yasser, Paul Contat, codeBasePlusPlus, kefahB, Chris Johns, jessorlisa, diego, Dariusz and Jarrod Whitley
I have found that scoping any Button and Label styles to Page leaves the OS's defaults (white label, blue button) in dialogs and menus, which was a good enough solution for us. So if you do Button { color: black } or Label { color: black } anywhere in your CSS, change it to Page Button { color: black }; Page Label { color: black}, and your alerts will be legible in both dark and light mode.
Reacted by Lochlan, Nikolay Iliev, jessorlisa, Macarthurval, Nithin Jadhav, Roman Drahan, Austin117, Art Bergquist and vdbongard
Reacted by Nithin Jadhav, Austin117, Art Bergquist and vdbongard
Right now this feature is more important due to the iOs 13 dark mode.
Now by default, without specifing otherwise, in dark mode the Label color is white!, so if we want our texts to be dark we must style the labels, afecting this to the dialogs too.
So we need urgently the ability to distinguish between plain label or dialogs texts.
A bit off topic but how did you manage to place buttons side by side? I can't find any info on NativeScript.com or anywhere else on how to achieve this layout.
If you want full customisation of your dialog you can use nativescript-material-dialogs which allows you to use a custom view in which you can do whatever !
There are a few examples in the vue demo app
I have found that scoping any Button and Label styles to Page leaves the OS's defaults (white label, blue button) in dialogs and menus, which was a good enough solution for us. So if you do Button { color: black } or Label { color: black } anywhere in your CSS, change it to Page Button { color: black }; Page Label { color: black}, and your alerts will be legible in both dark and light mode.
Thanks so much!!!!!!! This helped out a team of me, a co-worker, and a college student team so much 👍👍
Thanks for the request. Built-in dialogs follow the platform's native alert styling, and we don't plan to add separate title styling. For fully custom dialogs, @nativescript-community/ui-material-dialogs supports custom views, or you can show your own view with showModal. Closing.
Activity
tsonevn commentedon Mar 21, 2017
Hi @PeterStaev,
Thank you for your suggestion.
One option to change the color of the
LabelandButtontext is to Applying a globalCSSstyle color toLabelandButton, which will also affect the style of dialogs.Regarding that, another option is to use non-fullscreen modal page, which will allow you to style the child components inside it as you wish and to set up the
Colorand theFontStyleof the text.PeterStaev commentedon Mar 21, 2017
Hey @tsonevn ,
Both workarounds will not work:
Labelcolor/weight globally will affect both the title and the message.tsonevn commentedon Mar 28, 2017
Hi @PeterStaev,
Does it applicable for you, to create custom CSS selector, which allows setting the specific style for the Dialogs. For example:
PeterStaev commentedon Mar 28, 2017
Hi @tsonevn , I've tried putting that style in
app.cssbut seems it does not have any effect (I'm using {N} w/o Angular). Also wont that again style all the text on the dialog? What I want to achieve is when I use this:The "Success" word to be bold/black (or whatever the default iOS style is) while the text "Contact Saved!" to be whatever style I've setup for Label/Dialog. Instead I'm getting this:

Which makes the title indistinguishable from the message.
tsonevn commentedon Mar 28, 2017
Hi @PeterStaev.
Excuse me if I was not clear enough,
My question was if it is applicable for you, such a dialog selector to be created in the feature for some of the next NativeScirpt versions.
Regarding that, if I understand you correctly, you would like to change the style for each dialog individually.
PeterStaev commentedon Mar 28, 2017
Aha, ok the selector would make sense as long as it does not style the message label as well.
But how about we extend this in the following way, to give the most flexibility:
NathanaelA commentedon Mar 28, 2017
davecoffin commentedon Aug 25, 2017
This would be really great for styling a Delete option different from the rest of the options. For example, Delete in this list should be styled differently, like with red bold text (examples of this are in many iOS applications)

bhavincb commentedon Mar 9, 2018
if Dialog can have some extra property like 'cssClass' which can be set when creating dialog and this class will be added to dialog layout container then it will be very nice feature have.
+1
MetaiR commentedon Dec 4, 2018
is there any progress on this issue?
fpaaske commentedon Dec 19, 2018
It would be great to at least have the option to add a "destructive button" that would be red.
drewcovi commentedon Jan 2, 2019
agreed with @frapaa. would love to leverage this.
danielnitu commentedon Jun 21, 2019
Any progress or updates on this?
lochstar commentedon Jul 2, 2019
Obviously complete CSS control would be ideal. In the mean time we could add an option to use
destructiveButtonTextas an alternative tocancelButtonTextfor alert. It would then apply the destructive style (red) on iOS.Izrab commentedon Sep 4, 2019
+1 for styling options for dialogs
Macarthurval commentedon Oct 5, 2019
Right now this feature is more important due to the iOs 13 dark mode.

Now by default, without specifing otherwise, in dark mode the Label color is white!, so if we want our texts to be dark we must style the labels, afecting this to the dialogs too.
So we need urgently the ability to distinguish between plain label or dialogs texts.
Mottokrosh commentedon Oct 29, 2019
I have found that scoping any
ButtonandLabelstyles toPageleaves the OS's defaults (white label, blue button) in dialogs and menus, which was a good enough solution for us. So if you doButton { color: black }orLabel { color: black }anywhere in your CSS, change it toPage Button { color: black }; Page Label { color: black}, and your alerts will be legible in both dark and light mode.SmailHammour commentedon Jan 24, 2020
What's the status on this?
vahidvdn commentedon May 12, 2020
Any update on this?
andrewm-mitchells commentedon May 28, 2020
A bit off topic but how did you manage to place buttons side by side? I can't find any info on NativeScript.com or anywhere else on how to achieve this layout.
Thank you in advance!
dtomaszewski commentedon Aug 23, 2020
Any workaround or update on this ?
vahidvdn commentedon Aug 24, 2020
@andrewm-mitchells That is for iOS. As I know, you can't do it on Android.
dtomaszewski commentedon Aug 24, 2020
@vahidvdn @andrewm-mitchells
Try :
confirm({ title: 'Your title', message: 'lorem ipsum, cancelButtonText: 'Nope', okButtonText: 'Yup' })farfromrefug commentedon Aug 27, 2020
If you want full customisation of your dialog you can use nativescript-material-dialogs which allows you to use a custom view in which you can do whatever !
There are a few examples in the vue demo app
Austin117 commentedon Apr 16, 2021
Thanks so much!!!!!!! This helped out a team of me, a co-worker, and a college student team so much 👍👍
NathanWalker commentedon Oct 23, 2026
Thanks for the request. Built-in dialogs follow the platform's native alert styling, and we don't plan to add separate title styling. For fully custom dialogs,
@nativescript-community/ui-material-dialogssupports custom views, or you can show your own view withshowModal. Closing.