Class Samp


@Bean(typeName="samp") public class Samp extends HtmlElementMixed
DTO for an HTML <samp> element.

The samp element represents sample or quoted output from a computer program or system. It is used to mark up text that represents the output of a program, command, or system, such as console output, error messages, or program results. The samp element is typically rendered in a monospace font and is commonly used in documentation, tutorials, and technical writing to distinguish program output from regular text.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple sample output Samp simple = samp("Hello World"); // Samp with styling Samp styled = samp("$ npm install") ._class("console-output"); // Samp with complex content Samp complex = samp( "Error: ", strong("File not found"), " at line 42" ); // Samp with ID Samp withId = samp("Sample output with ID") .id("sample-output"); // Samp with styling Samp styled2 = samp("Custom styled sample output") .style("background-color: #f4f4f4; padding: 5px; border: 1px solid #ddd;"); // Samp with multiple elements Samp multiple = samp( "$ ", samp("ls -la"), "\n", samp("total 24"), "\n", new Samp().children("drwxr-xr-x 5 user staff 160 Jan 15 10:30 .") ); // Samp with links Samp withLinks = new Samp() .children( "See ", new A().href("/docs/output").children("output documentation"), " for more details." );

See Also: