Skip to main content
Elastic UI
Elastic UI
Getting startedComponentsPatternsContentData visualization
EUI ChangelogGitHubFigma
  • Setup
  • Theming
    • Theme provider
    • Tokens
      • Borders
      • Breakpoints
      • Colors
      • Sizing
      • Typography
        • Font weight
        • Font settings
        • Font scale hook
    • Color mode
    • High contrast mode
    • Utilities
  • Accessibility
  • Utilities
  • Testing
  • EUI
  • Theming
  • Tokens
  • Typography
  • Font settings

Font settings

euiTheme.font.family token

The whole font family stack for all parts of the UI. We encourage only customizing the first font in the stack.

All of EUI defaults to the base font.family. However, you can use this token to change specific instances.

'Inter', BlinkMacSystemFont, Helvetica, Arial, sans-serif

โœ„๐˜—
tsx code block:
โœ„๐˜—css` font-family: ${euiTheme.font.family}; `

euiTheme.font.familyCode token

The font family used for monospace UI elements like EuiCode

'Roboto Mono', Menlo, Courier, monospace

โœ„๐˜—
tsx code block:
โœ„๐˜—css` font-family: ${euiTheme.font.familyCode}; `

euiTheme.font.familySerif token

The font family used for serif UI elements like blockquotes within EuiText

Georgia, Times, Times New Roman, serif

โœ„๐˜—
tsx code block:
โœ„๐˜—css` font-family: ${euiTheme.font.familySerif}; `

euiTheme.font.featureSettings token

Controls advanced features OpenType fonts.

https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings

'calt' 1, 'kern' 1, 'liga' 1

โœ„๐˜—
tsx code block:
โœ„๐˜—css` font-feature-settings: ${euiTheme.font.featureSettings}; `

euiTheme.font.defaultUnits token

Sets the default units used for font size & line height set by UI components like EuiText or EuiTitle. Defaults to rem.

Note: This may override by some internal usages, e.g. EuiText's relative size which must use em.

Hello world

โœ„๐˜—
tsx code block:
โœ„๐˜—<EuiProvider modify={{ font: { defaultUnits: 'px' } }}> <EuiText> <p>Hello world</p> </EuiText> </EuiProvider>
Edit this page

Previous
Font weight
Next
Font scale hook
  • euiTheme.font.family token
  • euiTheme.font.familyCode token
  • euiTheme.font.familySerif token
  • euiTheme.font.featureSettings token
  • euiTheme.font.defaultUnits token
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with โค by Elastic