Skip to content
On this page

Typography

Classes

Anu provides useful classes like .a-title & .a-subtitle for rendering typography with consistency.

Title

Subtitle

Basic

ATypography component provides customizable typography to render title, subtitle & text using single component.

You might feel like this is useless but this greatly improves DX and boosts component reusability. This will completely change how you work with typography.

Title

This is subtitle

When not to use ATypography component?

If you want to render either title, subtitle or text only, prefer using respective class (for text you don't need any class, please read below note) instead of component.

ATypography is for rendering title, subtitle & text easily or adding custom content on right via header-right slot.

In summary, it provides common structure (flex) we use in our apps regularly.

ATypography's text prop

text prop is for convenience so you don't have to do this:

vue
<template>
  <ATypography
    title="Title"
    subtitle="This is subtitle"
  >
    <p>This is text</p>
  </ATypography>
</template>

Instead you can just insert text using text prop.

vue
<template>
  <ATypography
    title="Title"
    subtitle="This is subtitle"
    text="This is text"
  />
</template>

When you use text prop of ATypography component, it adds class .a-text to customize that particular text rendered using ATypography component.

Sizing

Want to create a list with title and subtitle no worries, Just add text-sm.

You can use other font-size utilities to change typography size.

PayPal

last payment

+$789

Credit card

ordered books

-$13.6

Server storage

90% storage used

4 minutes ago

Config Array

You can configure title, subtitle & text by passing array as prop instead of string.

First element of array will be treated as content and rest of them will be classes. You can create various layout using custom classes without writing same markup.

It greatly improves DX and keep you code a bit DRY.

Sales

2.5k

Revenue

$816

Customers

1.5

Returns

1.5

API

Typography

titleTag : string

Tag to use for title of the component

subtitleTag : string

Tag to use for subtitle of the component

textTag : string

Tag to use for text rendered via text prop

text : ConfigurableValue

Typography text content

title : ConfigurableValue

Typography title

subtitle : ConfigurableValue

Typography subtitle

title : any

Render custom content for title

subtitle : any

Render custom content for subtitle

header-right : any

Render custom content on right side of title & subtitle. Content inside this slot will be vertically centered to title & subtitle.

default : any

Default slot for rendering text.

Released under the MIT License.