Skip to content
daisyBlazor

MockupCode

A daisyUI terminal frame with a prefix on every line. Pass Lines for quick shell snippets, or write your own pre rows to vary prefixes and highlight lines.
Mockup.mockup-code
Cover · <MockupCode>
dotnet new blazor
dotnet add package
  DaisyBlazor
restoring…
Done. Ready to ship!

Examples

Lines

Each string in Lines becomes a row prefixed with $.

dotnet new blazor -n AcmeAdmin
cd AcmeAdmin
dotnet add package DaisyBlazor
dotnet run
website/Examples/Mockup/MockupCodeLinesExample.razor Source

Prefix

Prefix changes the marker; Class can recolour the frame.

deploy --env staging
status
logs --tail 50
website/Examples/Mockup/MockupCodePrefixExample.razor Source

Custom rows

Child content gives each pre its own data-prefix and classes, for numbered or highlighted lines.

<Button Color="Color.Primary">
    Save changes
</Button>
warning: highlight a line with any class
website/Examples/Mockup/MockupCodeCustomExample.razor Source

API

<MockupCode>

DaisyBlazor

Parameters

  • Lines IReadOnlyList<string>
    = null

    Convenience list of code lines; each is wrapped in <pre data-prefix="..."><code> automatically.

  • Prefix string
    = "$"

    The prefix shown before each line when using Lines. Defaults to "$".

  • Class string
    = null

    Extra CSS classes merged onto the mockup-code element.

  • Style string
    = null

    Inline CSS styles applied to the mockup-code element.

Content

  • ChildContent RenderFragment

    Content rendered verbatim inside the code block (use when you need custom <pre> rows).

Something went wrong while running the docs. Reload