Phoenix UI

Phoenix UI home page
  1. Getting Started
  2. Installation: Tailwind CLI

Typography

Use typography to present your design and content as clearly and efficiently as possible.

Too many type sizes and styles at once can spoil any layout. A typographic scale has a limited set of type sizes that work well together along with the layout grid.

Examples

Below you can view various demos with example markup.

Variant

The Typography component makes it easy to apply a default set of font weights and sizes in your application.

h1. Heading

h2. Heading

h3. Heading

h4. Heading

p. body

Element

The Typography component makes it easy to switch styles to specific html elements.

p. body

h1. Heading

Alignment

The Typography component makes it easy to apply a default set of font weights and sizes in your application.

Left Alignment

Center Alignment

Right Alignment

Color

The Typography component makes it easy to apply a default set of font weights and sizes in your application.

Primary

Secondary

Success

Danger

Warning

Info

Margin

The Typography component makes it easy to apply a default set of font weights and sizes in your application.

With Margin (default)

Without Margin

API

API documentation for the component. Learn about imports and available attributes.

Import

There are multiple ways to import components.


    # PhoenixUI macro which imports all components
    use PhoenixUI
    # Or import component individually
    import PhoenixUI.Components.Alert
    

Attributes

Below is a list of attributes that can be applied to the component.

Name Type Default Description
HTML attribute any Supports all HTML attributes.
align :center | :inherit | :justify | :left | :right :inherit Set the text-align on the component.
color any framework-provided color :slate The text color to use.
element Any HTML Element :p HTML element to use.
extend_class string Adds additional classes.
margin bool true If true, the text will have margin.
phx-{any} binding Supports all Phoenix DOM element bindings.
variant :h1 | :h2 | :h3 | :h4 | :p :p The links to use.