Hyperlink
Hyperlink A text component that is able to handle click event on the text.
Parameters
The label to be displayed.
Modifier to apply to this layout node.
Style configuration for the text such as color, font, line height etc.
HyperlinkColor different set of colors for the text
either if the link has been activated or not
The MutableInteractionSource representing the stream of Interactions for this component. You can create and pass in your own remembered MutableInteractionSource if you want to observe Interactions and customize the appearance / behavior of this component in different Interactions.
Callback that is executed when users click the text. This callback is called with clicked character's offset. The active param should be set as true if the action succeeds
See also
Samples
import androidx.compose.foundation.clickable
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.text.BasicText
import androidx.compose.material3.LocalTextStyle
import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.Preview
import net.ikea.skapa.foundation.*
import net.ikea.skapa.ui.components.Checkbox
import net.ikea.skapa.ui.components.Hyperlink
import net.ikea.skapa.ui.components.HyperlinkColor
import net.ikea.skapa.ui.components.hyperlinkStyle
fun main() {
//sampleStart
var active by remember { mutableStateOf(false) }
var checked by remember { mutableStateOf(false) }
SkapaThemeM3(darkTheme = isSystemInDarkTheme()) {
Row(horizontalArrangement = Arrangement.spacedBy(SkapaSpacing.space100)) {
Checkbox(
checked = checked,
onCheckedChange = { checked = !checked }
)
Hyperlink(
text = "I have read the terms and conditions",
active = active,
onClick = {
// Do something and set hyperlink as active
active = true
}
)
}
}
//sampleEnd
}