Note

fun SequenceDiagramScope.Note(text: String, modifier: Modifier = Modifier)

Standard note styled by the SequenceDiagramStyle. To just draw text without the border use the Label composable. To use your own composables with the standard note background and border, use NoteBox.

This is a convenience function for wrapping a Label inside a NoteBox.

Samples

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.unit.dp
import com.zachklipp.seqdiag.ArrowHeadType
import com.zachklipp.seqdiag.BasicSequenceDiagramStyle
import com.zachklipp.seqdiag.Label
import com.zachklipp.seqdiag.LineStyle
import com.zachklipp.seqdiag.Note
import com.zachklipp.seqdiag.SequenceDiagram
import com.zachklipp.seqdiag.arrowHeadType
import com.zachklipp.seqdiag.color
import com.zachklipp.seqdiag.createParticipant
import com.zachklipp.seqdiag.noteOver
fun main() { 
   //sampleStart 
   // In addition to lines, notes can also be placed around participants.
SequenceDiagram {
    val alice = createParticipant { Note("Alice") }
    createParticipant { Note("Bob") }
    val carlos = createParticipant { Note("Carlos") }

    noteToStartOf(alice) { Note("Note to the start of Alice") }
    noteOver(alice) { Note("Note over Alice") }
    noteToEndOf(alice) { Note("Note to the end of Alice") }

    noteOver(alice, carlos) { Note("Note over multiple participants") }
} 
   //sampleEnd
}

Sources

Link copied to clipboard