v4.0.0-beta.4

Typography

Guidance for using and tuning typography.

Typography clusters

Shuriken UI provides BaseHeading, BaseParagraph and BaseText components to render titles and body copy. These components share size and weight props and map to an underlying type system to ensure consistent typography throughout your app.

Iam a text heading

Iam a text paragraph here to show you how to use the typography components. Each one has a configurable size, weight and line height.

vue
<template>
  <BaseHeading
    as="h4"
    size="lg"
    weight="semibold"
    class="mb-4"
  >
    Iam a text heading
  </BaseHeading>
  <BaseParagraph size="md">
    Iam a text paragraph here to show you how to
    use the typography components. Each one has a
    configurable size, weight and line height.
  </BaseParagraph>
</template>

Formatting

You can nest typography components to create rich text formatting.

vue
<template>
  <BaseParagraph size="sm">
    This is a
    <BaseText weight="semibold">
      very important
    </BaseText>
    message!
  </BaseParagraph>
</template>

Type scale

The typographic system is based on a 13 step scale, every step has a corresponding font-size, line-height and letter-spacing value which are all designed to be used in combination.

Aa
xs
Aa
sm
Aa
md
Aa
lg
Aa
xl
Aa
2xl
Aa
3xl
Aa
4xl
Aa
5xl
Aa
6xl
Aa
7xl
Aa
8xl
Aa
9xl
Size Font size Letter spacing Line height
xs
0.75rem
0
1rem
sm
0.875rem
0
1.25rem
md
1rem
0
1.5rem
lg
1.125rem
0
1.75rem
xl
1.25rem
0
1.75rem
2xl
1.5rem
0
2rem
3xl
1.875rem
0
2.25rem
4xl
2.25rem
0
2.5rem
5xl
3rem
0
1
6xl
3.75rem
0
1
7xl
4.5rem
0
1
8xl
6rem
0
1
9xl
8rem
0
1

Font weight

The following weights are supported. When using the typography components, you can use the weight prop to set the font weight.

Light text
Normal text
Medium text
Semibold text
Bold text
Extrabold text
Weight Default Value
light
300
normal
400
medium
500
semibold
600
bold
700
extrabold
800

Customizing fonts

Both BaseHeading and BaseParagraph components use the --font-sans and --font-heading CSS variables to set the font family.

You can override them in your CSS file to use custom fonts, note that fonts should be loaded separately in your project.

css
@theme {
  /** Fonts */
  --font-sans: Inter, sans-serif;
  --font-heading: Roboto, sans-serif;
}
Important note

With this new CSS variables approach, Tailwind v4 is able to infer font classes if your variables start with the --font-* prefix. If you create a --font-custom variable, Tailwind will automatically generate classes like font-custom.

Loading fonts

Use the @nuxt/fonts module to load custom fonts in your Nuxt.js project.

bash
pnpm add -D @nuxt/fonts
ts
export default defineNuxtConfig({
  modules: [
    '@shuriken-ui/nuxt',
    '@nuxt/fonts',   ],
  fonts: {
    experimental: {
      processCSSVariables: true,     },
  },
})