Passive and Active Html Components Types

Passive Components

class oj.PC.Label

Inherits PassiveHCComponent

Parameters:
  • for (str or None, optional) – The ‘for’ attribute of the <label> element specifies the id of the form control with which the label is associated. The value is the id of a form control element.

  • form (str or None, optional) – The ‘form’ attribute of the <label> element specifies the id of the form to which the label belongs. The value is the id of a <form> element.

class oj.PC.Span

Inherits PassiveHCComponent

class oj.PC.Code

Inherits PassiveHCComponent

The Code class represents the HTML <code> element, which is used to display inline code.

class oj.PC.Pre

Inherits PassiveHCComponent

The Pre class represents the HTML <pre> element, which is used to display preformatted text.

class oj.PC.Li

Inherits PassiveHCComponent

The Li class represents the HTML <li> element, which is used to define list items within a list.

class oj.PC.P

Inherits PassiveHCComponent

The P class represents the HTML <p> element, which is used to define paragraphs.

class oj.PC.Prose

Inherits PassiveHCComponent

The Prose class represents a block-level component for displaying prose content.

class oj.PC.Option

Inherits PassiveHCComponent

class oj.PC.Hr

Inherits PassiveHCComponent The Hr class represents the HTML <hr> element, which is used to create a thematic break or horizontal rule in a document.

class oj.PC.Img

Inherits PassiveHCComponent

class oj.PC.H1

Inherits PassiveHCComponent

Passive Div Components

class oj.PC.Div

Inherits PassiveDivComponent

class oj.PC.CodeDiv

Inherits PassiveDivComponent

The CodeDiv class represents a container used for displaying code blocks or code-related content. It provides styling and structure suitable for code presentation.

class oj.PC.PreDiv

Inherits PassiveDivComponent

The PreDiv class represents a container for preformatted text, often used for code snippets or other text where spacing and line breaks should be preserved.

class oj.PC.Collapsible

Inherits PassiveDivComponent

The Collapsible class represents a collapsible container that can expand and collapse to show or hide its content. It is often used for creating expandable sections or content.

Parameters:
  • hide_banner_text – The text displayed when the content is hidden. It informs the user to click the button to expand.

  • hide_banner_classes – CSS classes for styling the banner when the content is hidden.

  • toggler_classes – CSS classes for styling the button that toggles the collapsible content.

class oj.PC.Nav

Inherits PassiveDivComponent

The Nav class represents a navigation container, often used for creating menus, navigation bars, or links to different parts of a website.

class oj.PC.Footer

Inherits PassiveDivComponent

The Footer class represents the HTML <footer> element, which is used to define a footer section at the bottom of a document or a webpage. It typically contains copyright information, contact details, and other footer content.

Active HC Components

class oj.AC.Span

Inherits ActiveHCComponent

class oj.AC.Button

Inherits ActiveHCComponent

The Button class represents an HTML <button> element, which is used to create interactive buttons for user interaction.

Variables:
  • autofocus – Specifies whether the button should automatically get focus when the page loads. Possible values: True or False.

  • disabled – Specifies whether the button should be disabled or not. Possible values: True or False.

  • form – Specifies the form the button belongs to.

  • formaction – Specifies the URL of the file that will process the input control when the form is submitted.

  • formenctype – Specifies how the form-data should be encoded when submitting it to the server. Possible values: “application/x-www-form-urlencoded”, “multipart/form-data”, or “text/plain”.

  • formmethod – Specifies the HTTP method to use when sending form-data. Possible values: “GET” or “POST”.

  • formnovalidate – Specifies that the form-data should not be validated on submission. Possible values: True or False.

  • formtarget – Specifies where to display the response received after submitting the form. Possible values: “_blank”, “_self”, “_parent”, “_top”, or a custom target name.

class oj.AC.TextInput

Inherits ActiveHCComponent

Variables:
  • type – The type attribute associated with the element (always “text”).

  • autocomplete – Specifies whether the browser should enable autocomplete for the input field.

  • maxlength – Specifies the maximum number of characters allowed in the input field.

  • minlength – Specifies the minimum number of characters required in the input field.

  • pattern – Specifies a regular expression pattern that the input’s value must match to be valid.

  • placeholder – Provides a short hint that describes the expected value of the input field.

  • size – Specifies the visible width of the input field.

class oj.AC.Img

Inherits ActiveHCComponent

The Img class represents the HTML <img> element, used to display images in a document.

Variables:
  • alt – A text description of the image, providing a textual alternative for users who cannot see the image.

  • crossorigin – A CORS settings attribute that indicates how the element handles crossorigin requests. Possible values: ‘anonymous’, ‘use-credentials’.

  • height – The intrinsic height of the image, in pixels. Must be a positive integer.

  • ismap – Indicates that the image is part of a server-side image map. Value should be a boolean: True or False.

  • longdesc – A URL to a more detailed description of the image.

  • sizes – The sizes attribute for the image.

  • src – The source URL of the image.

  • srcset – The srcset attribute for responsive images.

  • usemap – Specifies a client-side image map for the image.

  • width – The intrinsic width of the image, in pixels. Must be a positive integer.

class oj.AC.CheckboxInput

Inherits ActiveHCComponent

The CheckboxInput class represents an HTML <input> element with a checkbox, allowing users to select or deselect an option.

Variables:

checked – Specifies whether the checkbox is initially checked (True) or unchecked (False). The value is a boolean.

class oj.AC.Textarea

Inherits ActiveHCComponent

The Textarea class represents an HTML <textarea> element, which provides a multiline text input area for users.

Variables:
  • cols – Specifies the visible width of the textarea in average character widths. Must be a positive integer.

  • rows – Specifies the visible number of lines in the textarea. Must be a positive integer.

  • wrap – Specifies how the text in the textarea is to be wrapped when submitted in a form. Possible values are “soft” (text wrapped for appearance only) and “hard” (text wrapped for both appearance and submitted text).

  • placeholder – Provides a short hint that describes the expected value of the textarea.

class oj.AC.Div

Inherits ActiveHCComponent

The Div class represents the HTML <div> element, used for structuring and styling content within a document.

class oj.AC.StackH

Inherits ActiveHCComponent

The StackH class represents a horizontal stack container for aligning and arranging elements horizontally within a container.

class oj.AC.Select

Inherits ActiveHCComponent

The Select class represents an HTML <select> element, used to create dropdown lists for user selection.

Variables:
  • autofocus – Specifies whether the select element should automatically get focus when the page loads. Possible values: True or False.

  • default – Specifies the default value for the select element.

  • disabled – Specifies whether the select element should be disabled or not. Possible values: True or False.

  • form – Specifies the form to which the select element belongs (form’s id).

  • multiple – Specifies that multiple options can be selected at once. If present, the attribute does not need a value.

  • name – Specifies the name for the select element.

  • required – Specifies whether the select element is required to have a value selected. Possible values: True or False.

  • size – Specifies the number of visible options in the dropdown list.

class oj.AC.Form

Inherits ActiveHCComponent

The Form class represents an HTML <form> element, which is used to create user input forms for submitting data.

Variables:
  • accept_charset – Specifies the character encodings to be used for form submission. A space-separated list of character encoding names (e.g., “UTF-8 ISO-8859-1”).

  • action – Specifies the URL where form data should be submitted when the form is submitted. It can be an absolute or relative URL.

  • autocomplete – Specifies whether the browser should enable autocomplete for the entire form. Values: ‘on’ or ‘off’.

  • enctype – Specifies how the form data should be encoded when submitted to the server. Possible values are ‘application/x-www-form-urlencoded’ (default), ‘multipart/form-data’ (required for file uploads), or ‘text/plain’.

  • method – Specifies the HTTP method to use when submitting the form data. Possible values: ‘get’ (default) or ‘post’.

  • name – Specifies a name for the form, which can be used for scripting purposes, such as referencing the form from JavaScript.

  • novalidate – A boolean attribute. When present, it specifies that the form should not be validated when submitted.

  • target – Specifies where the response received after submitting the form should be displayed. Possible values include ‘_blank’ (new window or tab), ‘_self’ (same frame), ‘_parent’ (parent frame), ‘_top’ (full window body), or a named frame.

class oj.AC.A

Inherits ActiveHCComponent

The A class represents an HTML <a> (anchor) element, used for creating hyperlinks within a document.

Variables:
  • href – Specifies the URL to which the hyperlink points.

  • title – Specifies the title of the linked document.

  • rel – Specifies the relationship between the current document and the linked document.

  • download – Specifies that the target will be downloaded when the link is clicked.

  • target – Specifies where to open the linked document. Values can include ‘_blank’, ‘_self’, ‘_parent’, ‘_top’, or a named frame.

  • scroll – Specifies whether scrolling is enabled when the hyperlink is clicked (True or False).

  • scroll_option – Specifies the type of scrolling when the hyperlink is clicked. Values can be “auto” or “smooth” (default is “smooth”).

  • block_option – Specifies the vertical alignment of the target element when scrolling. Values can be “start”, “center”, “end”, or “nearest” (default is “start”).

  • inline_option – Specifies the horizontal alignment of the target element when scrolling. Values can be “start”, “center”, “end”, or “nearest” (default is “nearest”).

class oj.AC.Switch

Inherits ActiveHCComponent

The Switch class represents a switch component, often used for on/off or toggle functionality within a user interface.