New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@snack-uikit/typography

Package Overview
Dependencies
Maintainers
0
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snack-uikit/typography

Текст во всех доступных стилях

0.8.5-preview-f7ec3fa7.0
Source
npm
Version published
Maintainers
0
Created
Source

Typography

Installation

npm i @snack-uikit/typography

Changelog

Example

import { Typography } from "@snack-uikit/typography";

<Typography 
  family='sans'
  purpose='display'
  size='s'
  tag='h1'
  className='some-element'
>
  Some text
</Typography>

Также чтобы не указывать пропсы family, purpose и size, воспользуйтесь нужным предустановленным вариантом, например:

<Typography.SansDisplayS tag='h1' className='some-element'>
  Some text
</Typography.SansDisplayS>

Все компоненты вида <Typography.{Family}{Purpose}{Size} /> генерируются автоматически при выполнении команды npm run build:packages.

Как добавить новый компонент такого вида?

  • Добавить новое свойство в один или несколько объектов FAMILY, PURPOSE, SIZE в файле constants.ts, который лежит в typography/src/components/constants.ts
  • Запустить скрипт compile в package.json пакета @typography
    "npm run build:typography-components && npm run build:constants && npm run build:index"
    
  • Готово! Можете использовать Typography с новым свойством

Typography

Props

nametypedefault valuedescription
size*enum Size: "s", "l", "m"-Размер
purpose*enum Purpose: "label", "body", "title", "display", "headline"-Роль
family*enum Family: "link", "sans", "light", "mono", "crossed-out"-Шрифт
tagenum Tag: "span", "h1", "h2", "h3", "h4", "h5", "h6", "div", "label", "p"spanHTML-тег
classNamestring-CSS-класс
childrenReactNode-Контент

FAQs

Package last updated on 25 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts