Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@snack-uikit/typography

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snack-uikit/typography

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

  • 0.6.2-preview-0a44b2fc.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
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.

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

  1. Добавить новое свойство в один или несколько объектов FAMILY, PURPOSE, SIZE в файле constants.ts, который лежит в typography/src/components/constants.ts
  2. Запустить скрипт compile в package.json пакета @typography
    "npm run build:typography-components && npm run build:constants && npm run build:index"
    
  3. Готово! Можете использовать 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 09 Apr 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc