Link

@Composable
fun Link(onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, size: ButtonSize = LinkDefaults.Regular, contentPadding: PaddingValues = size.paddingForLink(), shape: Shape = size.shapeForLink(), colors: ButtonColors = LinkDefaults.defaultColors(), trailingIcon: @Composable () -> Unit? = null, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, content: @Composable BoxScope.() -> Unit)

A Link is a text button with a optional trailing icon.

Parameters

onClick

the callback to be invoked when this link is clicked.

modifier

the Modifier to be applied to this link.

enabled

whether this link is enabled.

size

the size of this link.

contentPadding

the padding of this link.

shape

the shape of this link.

colors

the ButtonColors used by this link to resolve background color and content color.

trailingIcon

a trailing icon after the content, typically an Icon, default tint is ButtonColors.contentColor

interactionSource

the MutableInteractionSource representing the stream of Interactions for this link

content

the content of this link. typically a Text

Samples

import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.pico.spatial.ui.design.Link
import com.pico.spatial.ui.design.Text

fun main() { 
   //sampleStart 
   Link(onClick = {}) { Text("Link style button") } 
   //sampleEnd
}

@Composable
fun Link(onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, size: ButtonSize = LinkDefaults.Regular, contentPadding: PaddingValues = size.paddingForLink(), shape: Shape = size.shapeForLink(), colors: ButtonColors = LinkDefaults.defaultColors(), vibrants: ButtonVibrants = LinkDefaults.linkVibrants(), trailingIcon: @Composable () -> Unit? = null, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, content: @Composable BoxScope.() -> Unit)

A Link is a text button with a optional trailing icon.

Parameters

onClick

the callback to be invoked when this link is clicked.

modifier

the Modifier to be applied to this link.

enabled

whether this link is enabled.

size

the size of this link.

contentPadding

the padding of this link.

shape

the shape of this link.

colors

the ButtonColors used by this link to resolve background color and content color.

vibrants

the ButtonVibrants used by this link to resolve background vibrancy and content vibrancy.

trailingIcon

a trailing icon after the content, typically an Icon, default tint is ButtonColors.contentColor

interactionSource

the MutableInteractionSource representing the stream of Interactions for this link

content

the content of this link. typically a Text

Samples

import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.pico.spatial.ui.design.Link
import com.pico.spatial.ui.design.Text

fun main() { 
   //sampleStart 
   Link(onClick = {}) { Text("Link style button") } 
   //sampleEnd
}