Skip to content

API Reference

This reference includes Astris public exports and HTML wrapper helpers.

astris

__version__ = '0.1.4' module-attribute

Astris

Register a link tag to be injected in the document head.

add_head_script(src, **attributes)

Register a script tag to be injected in the document head.

build(output_dir='dist', clean_urls=False)

Generate static HTML files.

page(path)

Decorator to register a page (route).

run_dev(port=8000, reload=True)

Start the development server.

Component

Bases: ABC

Base class for all UI elements (widgets).

Element

Bases: Component

Represents a generic HTML tag. Works like a Flutter-style container that accepts children.

Text

Bases: Component

Render plain text without tags.

JsonCollection dataclass

JsonCollectionEntry dataclass

register_json_collection(app, *, name, directory, template, api_prefix='/api/collections', route_prefix=None, slug_field='slug')

astris.content

astris.lib

A

Bases: Element

Creates a hyperlink to another page or location.

Abbr

Bases: Element

Represents an abbreviation or acronym.

Address

Bases: Element

Provides contact information for a person or organization.

Area

Bases: Element

Defines a clickable area in an image map.

Article

Bases: Element

Represents a self-contained piece of content.

Aside

Bases: Element

Represents content related to surrounding content.

Audio

Bases: Element

Embeds sound content.

B

Bases: Element

Draws attention to text without extra semantic importance.

Base

Bases: Element

Specifies the base URL used for relative URLs in the document.

Bdi

Bases: Element

Isolates text direction from surrounding text.

Bdo

Bases: Element

Overrides the current text direction.

Blockquote

Bases: Element

Represents a section quoted from another source.

Body

Bases: Element

Contains the visible content of the document.

Br

Bases: Element

Inserts a line break.

Button

Bases: Element

Represents a clickable button control.

Canvas

Bases: Element

Provides a bitmap drawing surface scripted with JavaScript.

Caption

Bases: Element

Represents the caption of a table.

Cite

Bases: Element

Represents the title of a referenced creative work.

Code

Bases: Element

Represents a fragment of computer code.

Col

Bases: Element

Represents a column within a table column group.

Colgroup

Bases: Element

Groups columns in a table for shared formatting.

Data

Bases: Element

Associates content with a machine-readable value.

Datalist

Bases: Element

Provides predefined options for input controls.

Dd

Bases: Element

Represents a description entry in a description list.

Del

Bases: Element

Represents deleted content.

Details

Bases: Element

Represents a disclosure widget for expandable details.

Dfn

Bases: Element

Represents the defining instance of a term.

Dialog

Bases: Element

Represents a dialog box or interactive component.

Div

Bases: Element

Represents a generic block container.

Dl

Bases: Element

Represents a description list.

Dt

Bases: Element

Represents a term in a description list.

Em

Bases: Element

Represents stress emphasis.

Embed

Bases: Element

Embeds external content at the insertion point.

Fieldset

Bases: Element

Groups related form controls.

Figcaption

Bases: Element

Represents a caption for figure content.

Figure

Bases: Element

Represents self-contained content with optional caption.

Footer

Bases: Element

Represents footer content for a page or section.

Form

Bases: Element

Represents an interactive form.

H1

Bases: Element

Represents a top-level heading.

H2

Bases: Element

Represents a second-level heading.

H3

Bases: Element

Represents a third-level heading.

H4

Bases: Element

Represents a fourth-level heading.

H5

Bases: Element

Represents a fifth-level heading.

H6

Bases: Element

Represents a sixth-level heading.

Head

Bases: Element

Contains metadata for the document.

Header

Bases: Element

Represents introductory content for a page or section.

Hr

Bases: Element

Represents a thematic break between paragraphs.

Html

Bases: Element

Represents the root element of an HTML document.

I

Bases: Element

Represents text in an alternate voice or mood.

Iframe

Bases: Element

Embeds another HTML document.

Img

Bases: Element

Embeds an image.

Input

Bases: Element

Represents an input control.

Ins

Bases: Element

Represents inserted content.

Kbd

Bases: Element

Represents user input from a keyboard or similar device.

Label

Bases: Element

Represents a caption for a form control.

Legend

Bases: Element

Represents a caption for a fieldset.

Li

Bases: Element

Represents a list item.

Bases: Element

Links an external resource, such as a stylesheet.

Main

Bases: Element

Represents the dominant content of the document body.

Map

Bases: Element

Defines an image map with clickable regions.

Mark

Bases: Element

Represents highlighted text for reference.

Menu

Bases: Element

Represents a list of commands or options.

Meta

Bases: Element

Represents metadata not covered by other head elements.

Meter

Bases: Element

Represents a scalar measurement within a known range.

Nav

Bases: Element

Represents a section containing navigation links.

Noscript

Bases: Element

Represents fallback content when scripts are unavailable.

Object

Bases: Element

Represents an external resource, such as media.

Ol

Bases: Element

Represents an ordered list.

Optgroup

Bases: Element

Groups related options in a select control.

Option

Bases: Element

Represents a selectable option in a form control.

Output

Bases: Element

Represents the result of a calculation or user action.

P

Bases: Element

Represents a paragraph.

Param

Bases: Element

Defines parameters for an object element.

Picture

Bases: Element

Provides multiple image resources for responsive rendering.

Pre

Bases: Element

Represents preformatted text.

Progress

Bases: Element

Represents progress completion for a task.

Q

Bases: Element

Represents a short inline quotation.

Rp

Bases: Element

Provides fallback parentheses for ruby annotations.

Rt

Bases: Element

Represents ruby annotation text.

Ruby

Bases: Element

Represents ruby annotations for East Asian typography.

S

Bases: Element

Represents content that is no longer accurate or relevant.

Samp

Bases: Element

Represents sample output from a program.

Script

Bases: Element

Embeds executable script content.

Section

Bases: Element

Represents a standalone section of content.

Select

Bases: Element

Represents a select control.

Slot

Bases: Element

Defines an insertion point in a web component template.

Small

Bases: Element

Represents side comments or small print.

Source

Bases: Element

Specifies media resources for media or picture elements.

Span

Bases: Element

Represents a generic inline container.

Strong

Bases: Element

Represents strong importance.

Style

Bases: Element

Embeds CSS style rules.

Sub

Bases: Element

Represents subscript text.

Summary

Bases: Element

Represents a summary for a details element.

Sup

Bases: Element

Represents superscript text.

Svg

Bases: Element

Represents an SVG drawing container.

Table

Bases: Element

Represents tabular data.

Tbody

Bases: Element

Groups body rows in a table.

Td

Bases: Element

Represents a data cell in a table.

Template

Bases: Element

Holds markup fragments that are not rendered immediately.

Textarea

Bases: Element

Represents a multi-line plain-text editing control.

Tfoot

Bases: Element

Groups footer rows in a table.

Th

Bases: Element

Represents a header cell in a table.

Thead

Bases: Element

Groups header rows in a table.

Time

Bases: Element

Represents a specific date or time.

Title

Bases: Element

Represents the document title.

Tr

Bases: Element

Represents a row in a table.

Track

Bases: Element

Specifies timed text tracks for media elements.

U

Bases: Element

Represents non-textual annotation styling.

Ul

Bases: Element

Represents an unordered list.

Use

Bases: Element

Represents a element in SVG.

Var

Bases: Element

Represents a variable in code or math expressions.

Video

Bases: Element

Embeds video content.

Wbr

Bases: Element

Represents a line-break opportunity.

astris.layout

Column

Bases: Div

Convenience wrapper that applies a vertical flex layout.

Container

Bases: Div

Convenience wrapper for a generic container block.

Row

Bases: Div

Convenience wrapper that applies a horizontal flex layout.

astris.lib

A

Bases: Element

Creates a hyperlink to another page or location.

Abbr

Bases: Element

Represents an abbreviation or acronym.

Address

Bases: Element

Provides contact information for a person or organization.

Area

Bases: Element

Defines a clickable area in an image map.

Article

Bases: Element

Represents a self-contained piece of content.

Aside

Bases: Element

Represents content related to surrounding content.

Audio

Bases: Element

Embeds sound content.

B

Bases: Element

Draws attention to text without extra semantic importance.

Base

Bases: Element

Specifies the base URL used for relative URLs in the document.

Bdi

Bases: Element

Isolates text direction from surrounding text.

Bdo

Bases: Element

Overrides the current text direction.

Blockquote

Bases: Element

Represents a section quoted from another source.

Body

Bases: Element

Contains the visible content of the document.

Br

Bases: Element

Inserts a line break.

Button

Bases: Element

Represents a clickable button control.

Canvas

Bases: Element

Provides a bitmap drawing surface scripted with JavaScript.

Caption

Bases: Element

Represents the caption of a table.

Cite

Bases: Element

Represents the title of a referenced creative work.

Code

Bases: Element

Represents a fragment of computer code.

Col

Bases: Element

Represents a column within a table column group.

Colgroup

Bases: Element

Groups columns in a table for shared formatting.

Data

Bases: Element

Associates content with a machine-readable value.

Datalist

Bases: Element

Provides predefined options for input controls.

Dd

Bases: Element

Represents a description entry in a description list.

Del

Bases: Element

Represents deleted content.

Details

Bases: Element

Represents a disclosure widget for expandable details.

Dfn

Bases: Element

Represents the defining instance of a term.

Dialog

Bases: Element

Represents a dialog box or interactive component.

Div

Bases: Element

Represents a generic block container.

Dl

Bases: Element

Represents a description list.

Dt

Bases: Element

Represents a term in a description list.

Em

Bases: Element

Represents stress emphasis.

Embed

Bases: Element

Embeds external content at the insertion point.

Fieldset

Bases: Element

Groups related form controls.

Figcaption

Bases: Element

Represents a caption for figure content.

Figure

Bases: Element

Represents self-contained content with optional caption.

Footer

Bases: Element

Represents footer content for a page or section.

Form

Bases: Element

Represents an interactive form.

H1

Bases: Element

Represents a top-level heading.

H2

Bases: Element

Represents a second-level heading.

H3

Bases: Element

Represents a third-level heading.

H4

Bases: Element

Represents a fourth-level heading.

H5

Bases: Element

Represents a fifth-level heading.

H6

Bases: Element

Represents a sixth-level heading.

Head

Bases: Element

Contains metadata for the document.

Header

Bases: Element

Represents introductory content for a page or section.

Hr

Bases: Element

Represents a thematic break between paragraphs.

Html

Bases: Element

Represents the root element of an HTML document.

I

Bases: Element

Represents text in an alternate voice or mood.

Iframe

Bases: Element

Embeds another HTML document.

Img

Bases: Element

Embeds an image.

Input

Bases: Element

Represents an input control.

Ins

Bases: Element

Represents inserted content.

Kbd

Bases: Element

Represents user input from a keyboard or similar device.

Label

Bases: Element

Represents a caption for a form control.

Legend

Bases: Element

Represents a caption for a fieldset.

Li

Bases: Element

Represents a list item.

Bases: Element

Links an external resource, such as a stylesheet.

Main

Bases: Element

Represents the dominant content of the document body.

Map

Bases: Element

Defines an image map with clickable regions.

Mark

Bases: Element

Represents highlighted text for reference.

Menu

Bases: Element

Represents a list of commands or options.

Meta

Bases: Element

Represents metadata not covered by other head elements.

Meter

Bases: Element

Represents a scalar measurement within a known range.

Nav

Bases: Element

Represents a section containing navigation links.

Noscript

Bases: Element

Represents fallback content when scripts are unavailable.

Object

Bases: Element

Represents an external resource, such as media.

Ol

Bases: Element

Represents an ordered list.

Optgroup

Bases: Element

Groups related options in a select control.

Option

Bases: Element

Represents a selectable option in a form control.

Output

Bases: Element

Represents the result of a calculation or user action.

P

Bases: Element

Represents a paragraph.

Param

Bases: Element

Defines parameters for an object element.

Picture

Bases: Element

Provides multiple image resources for responsive rendering.

Pre

Bases: Element

Represents preformatted text.

Progress

Bases: Element

Represents progress completion for a task.

Q

Bases: Element

Represents a short inline quotation.

Rp

Bases: Element

Provides fallback parentheses for ruby annotations.

Rt

Bases: Element

Represents ruby annotation text.

Ruby

Bases: Element

Represents ruby annotations for East Asian typography.

S

Bases: Element

Represents content that is no longer accurate or relevant.

Samp

Bases: Element

Represents sample output from a program.

Script

Bases: Element

Embeds executable script content.

Section

Bases: Element

Represents a standalone section of content.

Select

Bases: Element

Represents a select control.

Slot

Bases: Element

Defines an insertion point in a web component template.

Small

Bases: Element

Represents side comments or small print.

Source

Bases: Element

Specifies media resources for media or picture elements.

Span

Bases: Element

Represents a generic inline container.

Strong

Bases: Element

Represents strong importance.

Style

Bases: Element

Embeds CSS style rules.

Sub

Bases: Element

Represents subscript text.

Summary

Bases: Element

Represents a summary for a details element.

Sup

Bases: Element

Represents superscript text.

Svg

Bases: Element

Represents an SVG drawing container.

Table

Bases: Element

Represents tabular data.

Tbody

Bases: Element

Groups body rows in a table.

Td

Bases: Element

Represents a data cell in a table.

Template

Bases: Element

Holds markup fragments that are not rendered immediately.

Textarea

Bases: Element

Represents a multi-line plain-text editing control.

Tfoot

Bases: Element

Groups footer rows in a table.

Th

Bases: Element

Represents a header cell in a table.

Thead

Bases: Element

Groups header rows in a table.

Time

Bases: Element

Represents a specific date or time.

Title

Bases: Element

Represents the document title.

Tr

Bases: Element

Represents a row in a table.

Track

Bases: Element

Specifies timed text tracks for media elements.

U

Bases: Element

Represents non-textual annotation styling.

Ul

Bases: Element

Represents an unordered list.

Use

Bases: Element

Represents a element in SVG.

Var

Bases: Element

Represents a variable in code or math expressions.

Video

Bases: Element

Embeds video content.

Wbr

Bases: Element

Represents a line-break opportunity.

astris.layout

Column

Bases: Div

Convenience wrapper that applies a vertical flex layout.

Container

Bases: Div

Convenience wrapper for a generic container block.

Row

Bases: Div

Convenience wrapper that applies a horizontal flex layout.