tyrian

package tyrian

Members list

Packages

package tyrian.cmds
package tyrian.htmx
package tyrian.http
package tyrian.runtime

Type members

Classlikes

object Aria extends AriaAttributes

Object used to provide Aria attribute syntax import tyrian.Aria.*

Object used to provide Aria attribute syntax import tyrian.Aria.*

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Aria.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Aria.type
sealed trait Attr[+M]

HTML attribute

HTML attribute

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Attribute
object EmptyAttribute.type
class Event[E, M]
trait Property
Show all
final case class Attribute(name: String, value: String) extends Attr[Nothing]

Attribute of an HTML tag

Attribute of an HTML tag

Attributes are like properties, but can be removed. This is important for attributes like disabled, hidden, selected where there is no value, they are present and therefore set, or absent and unset.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Attr[Nothing]
class Object
trait Matchable
class Any
Show all
object Attribute

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Attribute.type
object CSS

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
CSS.type
sealed trait Cmd[+F[_], +Msg]

A command describes some side-effect to perform.

A command describes some side-effect to perform.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Batch[F, Msg]
class Combine[F, Msg]
class Emit[Msg]
object None.type
class Run[F, A, Msg]
class SideEffect[F, A]
Show all
object Cmd

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Cmd.type
sealed trait Elem[+M]

An HTML element can be a tag or a text node

An HTML element can be a tag or a text node

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Empty.type
trait Html[M]
class RawTag[M]
class Tag[M]
class Text
case object Empty extends Elem[Nothing]

An Empty Node - renders nothing

An Empty Node - renders nothing

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Elem[Nothing]
class Object
trait Matchable
class Any
Show all
Self type
Empty.type
case object EmptyAttribute extends Attr[Nothing]

An attribute of an HTML tag that does not exist, used as a "do not render" placeholder

An attribute of an HTML tag that does not exist, used as a "do not render" placeholder

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Attr[Nothing]
class Object
trait Matchable
class Any
Show all
Self type
final case class Event[E <: Event, M](name: String, msg: E => M, preventDefault: Boolean, stopPropagation: Boolean, stopImmediatePropagation: Boolean) extends Attr[M]

Event handler

Event handler

Value parameters

msg

Message to produce when the event is triggered

name

Event name (e.g. "click")

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Attr[M]
class Object
trait Matchable
class Any
Show all
object Event

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Event.type
object HotReload

A very simple mechanism to allow automatic loading and saving of your applications model to local storage. Uses:

A very simple mechanism to allow automatic loading and saving of your applications model to local storage. Uses:

  • During development, allows you to carry on where you left off between site rebuilds.
  • Acts as a user session, to remember where a website/app visitor/user was when they left.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
HotReload.type
sealed trait Html[+M] extends Elem[M]

Base class for HTML tags

Base class for HTML tags

Attributes

Companion
object
Supertypes
trait Elem[M]
class Object
trait Matchable
class Any
Known subtypes
class RawTag[M]
class Tag[M]
object Html extends HtmlTags, HtmlAttributes

Object used to provide Html syntax import tyrian.Html.*

Object used to provide Html syntax import tyrian.Html.*

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
trait HtmlTags
class Object
trait Matchable
class Any
Show all
Self type
Html.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Html.type
trait HtmlTags

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Html.type
sealed trait Location

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class External
class Internal
object Location extends LocationPlatform

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
Location.type
final case class LocationDetails(hash: Option[String], hostName: Option[String], pathName: String, port: Option[String], protocol: Option[String], search: Option[String], url: String)

Represents the deconstructed parts of a url.

Represents the deconstructed parts of a url.

Value parameters

hash

The anchor in the url starting with '#' followed by the fragment of the URL.

hostName

The name of host, e.g. localhost.

pathName

Is the path minus hash anchors and query params, e.g. "/page1".

port

Is the port number of the URL, e.g. 80.

protocol

The protocol e.g. https:

search

Is a String containing a '?' followed by the parameters of the URL.

url

The whole URL.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Location.type
final case class NamedAttribute(name: String) extends Attr[Nothing]

An attribute of an HTML tag that only has a name, no value

An attribute of an HTML tag that only has a name, no value

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Attr[Nothing]
class Object
trait Matchable
class Any
Show all
object Nav

The Nav object provides Cmds that are mainly expected to be used in conjunction with Tyrian's frontend routing. It exposes some of the functions from the JS Location and History apis.

The Nav object provides Cmds that are mainly expected to be used in conjunction with Tyrian's frontend routing. It exposes some of the functions from the JS Location and History apis.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Nav.type
sealed trait Property extends Attr[Nothing]

Attributes

Companion
object
Supertypes
trait Attr[Nothing]
class Object
trait Matchable
class Any
Known subtypes
object Property

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Property.type
final case class PropertyBoolean(name: String, value: Boolean) extends Property

Property of a DOM node instance

Property of a DOM node instance

Properties are a type of attribute that can only be set, not removed.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Property
trait Attr[Nothing]
class Object
trait Matchable
class Any
Show all
final case class PropertyString(name: String, value: String) extends Property

Property of a DOM node instance

Property of a DOM node instance

Properties are a type of attribute that can only be set, not removed.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Property
trait Attr[Nothing]
class Object
trait Matchable
class Any
Show all
final case class RawTag[+M](name: String, attributes: List[Attr[M]], innerHTML: String, key: Option[String]) extends Html[M]

An HTML tag with raw HTML rendered inside. Beware that the inner HTML is not validated to be correct, nor does it get modified as a response to messages in any way.

An HTML tag with raw HTML rendered inside. Beware that the inner HTML is not validated to be correct, nor does it get modified as a response to messages in any way.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Html[M]
trait Elem[M]
class Object
trait Matchable
class Any
Show all
object RawTag

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
RawTag.type
object Routing

Provides a number of convenience functions to help with routing in simple use-cases. Here the Location type is typically hidden away and the user is expected to match on the String href (if at all).

Provides a number of convenience functions to help with routing in simple use-cases. Here the Location type is typically hidden away and the user is expected to match on the String href (if at all).

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Routing.type
object SVG extends SVGTags, SVGAttributes

Object used to provide SVG syntax import tyrian.SVG.*

Object used to provide SVG syntax import tyrian.SVG.*

Attributes

Supertypes
trait SVGTags
class Object
trait Matchable
class Any
Self type
SVG.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object SVG.type
trait SVGTags

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object SVG.type
object Style

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Style.type
sealed trait Sub[+F[_], +Msg]

A subscription describes a resource that an application is interested in.

A subscription describes a resource that an application is interested in.

Examples:

  • a timeout notifies its subscribers when it expires,
  • a video being played notifies its subscribers with subtitles.

Type parameters

Msg

Type of message produced by the resource

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Batch[F, Msg]
class Combine[F, Msg]
object None.type
class Observe[F, A, Msg]
object Sub

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Sub.type
final case class Tag[+M](name: String, attributes: List[Attr[M]], children: List[Elem[M]], key: Option[String]) extends Html[M]

An HTML tag

An HTML tag

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Html[M]
trait Elem[M]
class Object
trait Matchable
class Any
Show all
object Tag

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Tag.type
final case class Text(value: String) extends Elem[Nothing]

A text node

A text node

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Elem[Nothing]
class Object
trait Matchable
class Any
Show all
object Tyrian

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Tyrian.type
trait TyrianAppF[F[_], Msg, Model]

The TyrianApp trait can be extended to conveniently prompt you for all the methods needed for a Tyrian app, as well as providing a number of standard app launching methods.

The TyrianApp trait can be extended to conveniently prompt you for all the methods needed for a Tyrian app, as well as providing a number of standard app launching methods.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait TyrianIOApp[Msg, Model]
trait TyrianZIOApp[Msg, Model]
object TyrianAppF

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
TyrianAppF.type
trait TyrianIOApp[Msg, Model] extends TyrianAppF[IO, Msg, Model]

The TyrianApp trait can be extended to conveniently prompt you for all the methods needed for a Tyrian app, as well as providing a number of standard app launching methods.

The TyrianApp trait can be extended to conveniently prompt you for all the methods needed for a Tyrian app, as well as providing a number of standard app launching methods.

Attributes

Companion
object
Supertypes
trait TyrianAppF[IO, Msg, Model]
class Object
trait Matchable
class Any
object TyrianIOApp

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait TyrianZIOApp[Msg, Model](using x$1: Async[Task]) extends TyrianAppF[Task, Msg, Model]

The TyrianApp trait can be extended to conveniently prompt you for all the methods needed for a Tyrian app, as well as providing a number of standard app launching methods.

The TyrianApp trait can be extended to conveniently prompt you for all the methods needed for a Tyrian app, as well as providing a number of standard app launching methods.

Attributes

Companion
object
Supertypes
trait TyrianAppF[Task, Msg, Model]
class Object
trait Matchable
class Any
object TyrianZIOApp

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
object syntax

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
syntax.type

Types

opaque type Style

Value members

Concrete fields

Extensions

Extensions

extension (a: Attr[_])
def render: String
extension (a: Attribute)
def render: String
extension [Msg](elem: Elem[Msg])
def render: String
extension [Msg](elems: List[Elem[Msg]])
def render: String
extension [Msg](html: Html[Msg])
def render: String
extension (p: Property)
def render: String