OudsLink

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

OUDS Link design guidelines

An OUDS link which displays a label 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 OudsLinkTokens.colorContentEnabledMono).

Parameters

label

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 link.

enabled

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

Samples

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

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

fun OudsLink(label: 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 label.

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 OudsLinkTokens.colorContentEnabledMono).

Parameters

label

Text displayed in the link.

arrow

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

onClick

Callback invoked when the link is clicked.

modifier

Modifier applied to the link.

size

Size of the link.

enabled

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

Samples

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

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