OudsLink

fun OudsLink(text: String, icon: OudsLink.Icon?, onClick: () -> Unit, modifier: Modifier = Modifier, size: OudsLink.Size = OudsLinkDefaults.Size, enabled: Boolean = true)

An OUDS link which displays a text and an optional icon.

In the case it is used in an OudsColoredBox, its monochrome variant is automatically displayed. The tokens associated with this variant can be customized and are identified with the Mono suffix (for instance colorContentEnabledMono in OudsLinkTokens).

Parameters

text

Text displayed in the link.

icon

Icon displayed in the link.

onClick

Callback invoked when the link is clicked.

modifier

Modifier applied to the link.

size

Size of the button.

enabled

Controls the enabled state of the link. When false, the link will not be clickable.

Samples

import androidx.compose.runtime.Composable
import androidx.compose.ui.res.painterResource
import com.orange.ouds.core.component.link.OudsLink

fun main() { 
   //sampleStart 
   OudsLink(
    text = "Link",
    icon = OudsLink.Icon(painterResource(id = android.R.drawable.star_on)),
    onClick = { /* Do something! */ },
) 
   //sampleEnd
}

fun OudsLink(text: String, arrow: OudsLink.Arrow, onClick: () -> Unit, modifier: Modifier = Modifier, size: OudsLink.Size = OudsLinkDefaults.Size, enabled: Boolean = true)

An OUDS link which displays an arrow before (OudsLink.Arrow.Back) or after (OudsLink.Arrow.Next) a text.

In the case it is used in an OudsColoredBox, its monochrome variant is automatically displayed. The tokens associated with this variant can be customized and are identified with the Mono suffix (for instance colorContentEnabledMono in OudsLinkTokens).

Parameters

text

Text displayed in the link.

arrow

Arrow displayed in the link. When OudsLink.Arrow.Back, the arrow is displayed before the text. When OudsLink.Arrow.Next, the arrow is displayed after the text.

onClick

Callback invoked when the link is clicked.

modifier

Modifier applied to the link.

size

Size of the button.

enabled

Controls the enabled state of the link. When false, the link will not be clickable.

Samples

import androidx.compose.runtime.Composable
import androidx.compose.ui.res.painterResource
import com.orange.ouds.core.component.link.OudsLink

fun main() { 
   //sampleStart 
   OudsLink(
    text = "Link",
    arrow = OudsLink.Arrow.Next,
    onClick = { /* Do something! */ },
) 
   //sampleEnd
}