lenards/elm-ui-patternfly/4.0.2

PF6.CodeBlock

PF6 CodeBlock component

Code blocks display read-only code in a formatted, accessible container.

See: https://www.patternfly.org/components/code-block

Definition

type CodeBlock msg

Opaque CodeBlock type

Constructor

codeBlock : String -> CodeBlock msg

Construct a CodeBlock with code text

Modifiers

withActions : Element msg -> CodeBlock msg -> CodeBlock msg

Add action elements to the code block header (e.g., copy button)

withExpandable : (Bool -> msg) -> CodeBlock msg -> CodeBlock msg

Make the code block expandable/collapsible

withExpanded : Bool -> CodeBlock msg -> CodeBlock msg

Set the expanded state (use with withExpandable)

Rendering

toMarkup : Theme -> CodeBlock msg -> Element msg

Render the CodeBlock as an Element msg