Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Request for new functionality
View staffing
Description
Now, to change the textStyle of the text in a Button, you have to use the Slot API and add your custom Text child to the Button. Example:
Button(onClick = onClick) {
Text(
text = myText,
style = myTextStyle
)
}
As Button has a method override where you can pass text in, can we add a parameter for TextStyle?
Expected:
@Composable
fun Button(
text: String,
textStyle: TextStyle? = null,
modifier: Modifier = Modifier.None,
onClick: (() -> Unit)? = null,
style: ButtonStyle = ContainedButtonStyle()
)
Actual:
@Composable
fun Button(
text: String,
modifier: Modifier = Modifier.None,
onClick: (() -> Unit)? = null,
style: ButtonStyle = ContainedButtonStyle()
)