ZoonkWeb.Components.Text (Zoonk v0.1.0-dev)

View Source

Provides the UI for rendering text.

Summary

Functions

Renders a text element.

Functions

text(assigns)

Renders a text element.

Examples

<.text>Some text</.text>
<.text tag="h1">Some text</.text>
<.text size={:xl}>Some text</.text>
<.text variant={:secondary}>Some text</.text>

Attributes

  • tag (:string) - HTML tag to use for the text element. Defaults to "p".
  • size (:atom) - Size of the text. Defaults to :md. Must be one of :xxl, :xl, :lg, :md, :sm, or :xs.
  • weight (:atom) - Font weight of the text. Defaults to nil. Must be one of :bold, :semibold, :medium, :normal, or nil.
  • variant (:atom) - Color variant of the text. Defaults to :primary. Must be one of :primary, :secondary, :destructive, or :custom.
  • for (:string) - The for attribute for labels. Defaults to nil.
  • class (:any) - CSS class to apply to the text element. Defaults to nil.
  • id (:string) - ID of the text element. Defaults to nil.
  • Global attributes are accepted. HTML attributes to apply to the text element.

Slots

  • inner_block (required) - Content to render inside the text element.